A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
It is important to do this in AppleScript—not VBA—because I want to attach it to a recurring calendar event and have it triggered automatically. Using AppleScript, I could also set it up as a folder action and have it run when a file is dropped there, or any other number of ways to automate its use that would not be possible using VBA within Office.
I gave up trying to get Excel to behave as documented in its Dictionary. I instead solved this with Acrobat.
--set up some file path locations in variables
set sourceFile to "CincyData:Dropbox:PRODUCTION OFFICE:DriverSchedule.xlsx" as POSIX file
set destFile to "CincyData:Dropbox:TOOLS:xFer:DriverSchedule.pdf"
set printDest to "CincyData:Dropbox:TOOLS:Print-Office"
tell application "Adobe Acrobat"
set tempFile to open file sourceFile
-- add a delay b/c Acrobat uses a web service to convert the file
delay 7
save active doc to destFile
close active doc
end tell
-- Duplicate the new pdf to a folder that has a folder action set up to automatically print the file, then delete it.
tell application "Finder"
duplicate destFile to printDest
end tell