Re: How to specify print file in MS Excel 2004?
Re: How to specify print file in MS Excel 2004?
- Subject: Re: How to specify print file in MS Excel 2004?
- From: Michael Conner <email@hidden>
- Date: Tue, 25 Jan 2005 16:45:25 -0600
I'm just an AS dabbler, but here is the way I do this when having to output
a series of PDF files from a FileMaker database. I have to do a test to see
where the PDF file will be created, which will by default be the name of the
Filemaker file with a PDF extension each time the print is called. This can
be hard corded in the script or entered through a dialog. Then I have Finder
watch for the file and change its name before the script continues.
tell application "Finder"
set vDone to 0
repeat until vDone = 1
try
set pdfile to file NameofPDFfile as alias
set name of pdfile to NewNameofPDF
set vDone to 1
on error
delay 10
end try
end repeat
end tell
The NameofPDFfile would be the same for each sheet, and the new name
generated from the worksheet name or number. Make sure a file with the
default name doesn't exist before running or test for it and delete it.
Mike Conner
on 1/25/05 1:16 PM, Richard Rönnbäck at email@hidden wrote:
> I am trying to print each sheet as a separate PDF file in Excel 2004, but I
> can't find how to set the name and location of the print file.
>
> Assuming that the Active printer is Adobe PDF (distiller) the code below
> will output the file, but is there any way to tell Excel where to put the
> file, and more importantly, how to name it?
>
> tell application "Microsoft Excel"
> tell workbook 1
> set theSheet to worksheet 1
> print out theSheet with print to file --active printer "Adobe_PDF"
> end tell
> end tell
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> edu
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden