Help with Excel Print -

I want to write two different scripts - one is to select a different printer - the other is to print - save as pdf.

I’ve gotten this far (with help looking through the forum):

tell application “Microsoft Excel” to activate
tell application “System Events”
tell application process “Microsoft Excel”
tell menu bar 1
tell menu “File”
click
click menu item “Print…”
end tell
end tell
end tell
end tell

This gets me with an open printer dialog box - how do I select the “Printer” pop up button and then select a different printer, or alternatively how do I select the “Save as PDF” button.

Thanks for all your help.
Richard

With the Scripting Addition “Extra Suites” you can use the following after the “Print Dialog” box appears to print the spreadsheet.


tell the application "Extra Suites"
ES type key "return"
end tell

PS: Extra Suites is available at:
http://www.kanzu.com/index.html

Good Luck :smiley:

— Thanks - though I am trying to select “Save As PDF…” . I downloaded a copy of ES and have been playing with it - wihout success. Any ideas?
Thanks
Richard

Can anybody tell me why the following script doesn’t work (Office 2004)?

tell application “Microsoft Excel” to activate
tell application "System Events"tell application process “Microsoft Excel”
tell menu bar 1
tell menu “File”
click
click menu item “Print…”
tell window “Print”
tell UI element 4 of window “Print”
click button “Save As PDF…” of UI element 4 of window “Print”
end tell
end tell
end tell
end tell
end tell
end tell

Thanks -