I have been using Excel charts for some years for creating computer animated movies for teaching physics. However, in converting from VBA to AppleScript I have had trouble saving the charts as .jpeg files. I have tried the script below:
tell application "Microsoft Excel"
set filebasename to get value of cell "MovieName"
activate object chart object filebasename of sheet 1
set testfile to "test.jpg"
save as picture active chart picture type save as JPG file file name testfile
end tell
but AppleScript editor tells me the active chart doesn't understand the save as picture instruction. My work-around has been to use the script:
tell application "Microsoft Excel"
set filebasename to get value of cell "MovieName"
activate object chart object filebasename of sheet 1
copy picture active chart appearance screen format picture
end tell
and then past the clipboard into GraphicConverter to get a .jpeg file.
What am I doing that's stupid?