sgmpatnaik
Active Member
Hi
I have a code which is export from Excel to PDF, it was worked but suddenly i got an error when i will run the code that is
run time error 5
invalid procedure call or argument
my code is
[pre]
[/pre]
kindly suggest why it's happen
Thanks
SP
I have a code which is export from Excel to PDF, it was worked but suddenly i got an error when i will run the code that is
run time error 5
invalid procedure call or argument
my code is
[pre]
Code:
Private Sub CommandButton1_Click()
pdfName = ActiveSheet.Range("A1")
ChDir "C:temp" 'This is where youo set a defult file path.
fileSaveName = Application.GetSaveAsFilename(pdfName, _
fileFilter:="PDF Files (*.pdf), *.pdf")
If fileSaveName <> False Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
fileSaveName _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End If
MsgBox "File Saved to" & " " & fileSaveName
End Sub
kindly suggest why it's happen
Thanks
SP