Hello,
I have started successfully translating my VBA code to Applescript (I did have to read some books about Applescript before though). I am enjoying myself because I have found new ways of doing things.
For the moment, I have a problem::rolleyes:
In Excel 2008, when you use the dialog Save as… to save as PDF format, you have the choice saving the workbook or the active sheet.
I am trying to do that but when I run the script, it saves ALL the sheets as PDF format adding the name of the sheet to the name choosen for the file.
tell application "Microsoft Excel"
set eclectic to ((path to documents folder) as string) & "Eclectic" as string
set monfichier to eclectic & ":player1.pdf"
save sheet "individual" of active workbook in monfichier as PDF file format
end tell
I will have player1sheet1.pdf, player2sheet2.pdf etc.
When I look at the dictionnary it says :
save v: save an object
[in Macintosh path | Posix path] : the file in which to save the object
[as …PDF file Format… ]: the file type of the document in which to save the data
and
sheet n [inh. base objet]
Am I going to be able to do that that way or am I going to have to do that through the system events?
Thanks for helping.
(Edit)
I have just tried this code with “save as” found in the command of Excel Suite but with the same result:
tell application "Microsoft Excel"
set eclectic to ((path to documents folder) as string) & "Eclectic" as string
set monfichier to eclectic & ":player1.pdf"
save as sheet "individuel" of active workbook filename monfichier file format PDF file format
end tell
Browser: Safari 525.18
Operating System: Mac OS X (10.4)