ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as .pdf (https://www.excelbanter.com/excel-programming/370962-save-pdf.html)

spanner[_2_]

Save as .pdf
 
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!


Jean-Yves[_2_]

Save as .pdf
 
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.
RegardsJean-Yves"spanner" wrote in
message oups.com...
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!





All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com