Re: Best way to script Excel 2016 from Python
Re: Best way to script Excel 2016 from Python
- Subject: Re: Best way to script Excel 2016 from Python
- From: Christopher Stone <email@hidden>
- Date: Fri, 27 Mar 2015 04:54:54 -0500
On Mar 27, 2015, at 04:26, Felix Zumstein < email@hidden> wrote: But I discovered an issue with AppleScript directly - saving doesn't work properly:
tell application "Microsoft Excel" set new_book to make new workbook save workbook as new_book filename "test.xlsx" end tell
______________________________________________________________________
Hey Felix,
I think you've missed the correct syntax, but I'm testing in Excel 14.4.8 - so you'll have to double-check.
When you create new_book it is already of class workbook, so you don't need to refer to it as workbook <name>.
In any case this syntax is incorrect:
save workbook as new_book filename "test.xlsx"
This works:
----------------------------------------- set saveDir to path to downloads folder as text set newExcelFilePath to saveDir & "test.xlsx"
tell application "Microsoft Excel" activate set new_book to make new workbook save new_book in newExcelFilePath end tell -----------------------------------------
If you don't give Excel the full path to the new file it will be saved in the last directory where a file was manually saved.
-- Best Regards, Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden