Hi all,
Need some assistance on how to improve the code bellow to save a pdf with a filename equal to the value of "E16"
Thanks in advance....!
![]()
Please Login or Register to view this content.
Hi all,
Need some assistance on how to improve the code bellow to save a pdf with a filename equal to the value of "E16"
Thanks in advance....!
![]()
Please Login or Register to view this content.
Last edited by tfilipe; 06-23-2018 at 06:09 PM.
Since you didn't really specify the problem I guess it was the opendialog part.
![]()
Please Login or Register to view this content.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
E16 on what sheet?
If the file name is in E16 then get rid of this
and modify this![]()
Please Login or Register to view this content.
Qualify Range("16") with the sheet name if it is not the active sheet.![]()
Please Login or Register to view this content.
Thanks bakerman2 and 6String..!
@6StringJazzer Yes Range E16 is on the active sheet, And I would like the file name to be [Booking Confirmation_(Range("E16")] how to write that?
Booking Confirmation is fixed
Range E16 is a Variable
I suggested you remove GetSaveAsFilename. I may not have understood your requirements. GetSaveAsFilename will allow the user to save the file using any name he wants, in any folder he wants. The default will be the argument you provided but the user can change it. In the version I proposed the user gets no choice of file name or folder.![]()
Please Login or Register to view this content.
Can you clarify what you want to happen?
Hi String,
Sorry maybe I wasn't very clear...!
The code as I had it, would open a dialog box to finish the filename and choose a folder where to save it to.
What I am after is to automate the filename procedure since we were entering the value of E16 as part of the file name anyway, i.e. Booking Confirmation_"E16"
As I understand, the code as you provided does just that, but where is it saving the PDF to? Desktop?
It is saving the file to "current folder" which could be your Documents folder, or where your Excel file is saved. If you want to make it explicitly the same folder then:
or specify whichever other folder you would like to use instead.![]()
Please Login or Register to view this content.
How would I change this code to save the pdf to the desktop please?
Newby question I know
![]()
Please Login or Register to view this content.
Replace tfilipe with whatever your Windows user name is:
![]()
Please Login or Register to view this content.
To be on the safe side you have two possibilities.
or![]()
Please Login or Register to view this content.
So your code would look like![]()
Please Login or Register to view this content.
or![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks