Ok, so I’ve looked around on the internet for the last hour or so and I can’t make this command work in applescript and it’s incredibly frustrating!
I’m trying to copy a worksheet out of a workbook into a new document, then save that document into a folder on a networked drive.
The Applescript reference for Excel defines the “filename” tag like this:
"filename Unicode text Required. A string that indicates the name of the file to be saved. You can
include a full path; if you don’t, Excel saves the file in the current folder. "
well, when I include a full path in the “filename” it saves the the worksheet to the correct path, but includes the entire path in the name of the document!
here is my script as it stands now. I’ve tried both styles of path structure, HFS “:” and POSIX file path deliminators “/”
tell application "Microsoft Excel"
activate
activate top
if exists worksheet "Reconciliation Sheet" in active workbook then
set fName to (get value of range "C10" of worksheet "Info" of active workbook as text) & ".xlsx"
log fName
set thePath to "../Volumes/network1/Documents/Reconciliation Sheets/2009/"&fName
activate object worksheet "Reconciliation Sheet"
copy worksheet sheet "Reconciliation Sheet"
save as active sheet filename thePath
end if
end tell
Anyone see what I’m missing?
Thanks in advance for any help