Hello,
I am new VB. I would highly appreciate if someone can help me out.
I want to open a save as dialogue box with a file name = cell value and save the file in pdf.
I have written the code and it working.
Here is the problem - the file gets saved when i click the "save" and "cancel" button in the save as dialogue box.
When i click save - there is no pop up screen to indicate a pdf has been saved. The pdf opens when i close the save as window.
When i clink the cancel botton - a pdf get saved and opens.
Also the file name does not appears on the save as filename box while saving the file.
the macros is:
I am new VB. I would highly appreciate if someone can help me out.
I want to open a save as dialogue box with a file name = cell value and save the file in pdf.
I have written the code and it working.
Here is the problem - the file gets saved when i click the "save" and "cancel" button in the save as dialogue box.
When i click save - there is no pop up screen to indicate a pdf has been saved. The pdf opens when i close the save as window.
When i clink the cancel botton - a pdf get saved and opens.
Also the file name does not appears on the save as filename box while saving the file.
the macros is:
Code:
Sub SavePDF1()
'
'turn off screen updating
Dim Opendialog
'
'open dialog and set file type
Opendialog = Application.GetSaveAsFilename("", FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Sheet2!$CI$267")
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("Sheet2!$CI$267").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Last edited by a moderator: