Save as .pdf

S

spanner

I need to save an active sheet as a pdf with a specified file name. I
have read various postings in this group and written a small macro to
send the active area of my sheet to pdf printer and all that works
fine. How do I specifiy what I want the resulting pdf file to be called
(by default it saves it as the same names as the the source file).
Please go easy on me, I am not a VB expert and not particularly
technical!
 
J

Jean-Yves

Hi,

Once your first job done, use the "Name" function
Extract form VBA help
Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.

OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top