Hi Everyone,
This is my first post.
I'm trying to export the worksheet as PDF.
e.g
The current excel file is saved in path is C:\document\file\ABC
the current folder name is ABC.
B6 = 3
Below code is able to get be to save the PDF in the current folder C:\document\file\ABC as 3.pdf. But it will not save the document as ABC3.pdf.
This will able to get me to save the PDF as ABC3.pdf. But it will save the PDF to the prior folder C:\document\file. Not the sub-folder ABC.
What I want to do is to save the PDF in the folder C:\document\file\ABC as ABC3.pdf.
I do not want to set the location permanently to C:\document\file\ABC. Since this is a temple and will be copied and pasted around folders.
Any suggestions? Thank you very much.
This is my first post.
I'm trying to export the worksheet as PDF.
e.g
The current excel file is saved in path is C:\document\file\ABC
the current folder name is ABC.
B6 = 3
Below code is able to get be to save the PDF in the current folder C:\document\file\ABC as 3.pdf. But it will not save the document as ABC3.pdf.
VBA Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.path & "\" & Range("B6").Value & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True
This will able to get me to save the PDF as ABC3.pdf. But it will save the PDF to the prior folder C:\document\file. Not the sub-folder ABC.
VBA Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.path & Range("B6").Value & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True
What I want to do is to save the PDF in the folder C:\document\file\ABC as ABC3.pdf.
I do not want to set the location permanently to C:\document\file\ABC. Since this is a temple and will be copied and pasted around folders.
Any suggestions? Thank you very much.