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: Felix Zumstein <email@hidden>
- Date: Fri, 27 Mar 2015 10:26:04 +0100
Interesting, thanks! Yeah I think
Info.plist looks totally different in 2011 and 2016. I on the other hand tried the static glue with the dictionary from Excel 2011 which seems to work really nicely:
>>> from appscript.terminology import dump
>>> dump('Microsoft Excel', '/path/to/myappglue.py') # Excel 2011
>>> import myappglue
>>> from appscript import app
>>> app = app('Microsoft Excel', terms=myappglue) # Excel 2016
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
This opens a spreadsheet and it looks like it worked, but the file is not created and when you try to save it manually again, it tells you "Document not saved.". I think it only happens if the "startscreen" doesn't appear.