Saving an Excel worksheet as a .pdf file
Saving an Excel worksheet as a .pdf file
- Subject: Saving an Excel worksheet as a .pdf file
- From: Bill Guion <email@hidden>
- Date: Tue, 16 Dec 2014 16:52:51 -0500
I'm trying to create and save an Excel worksheet as a .pdf file. The script below is my current attempt. I have removed all of the Excel manipulation portion of the script to help focus on the file save portion. The manipulation portion works just fine. The script starts by prompting me for a csv file. The display dialogs all show the values I expect for the various values. The script runs without error, but no file is saved. I would really appreciate someone pointing out my errors.
-- find the csv file
set myLifeList to choose file with prompt "Locate Bill's Life List"
-- define folder to save .pdf into
set pdfSavePath to "/Macintosh HD:Documents:pdfs:" as string
tell application "Microsoft Excel"
activate
open myLifeList
end tell
SNIP
tell application "Microsoft Excel"
copy value of cell "N2" to filename
display dialog "filename is " & filename
display dialog "pdfSavePath is " & pdfSavePath
set fullName to pdfSavePath & filename & ".pdf"
display dialog fullName
try
save active sheet in fullName as PDF file format
end try
end tell
Thanks in advance.
-----===== Bill =====-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden