Hi,
I have a button in my sheet which creates a PDF of the sheet and saves it to the users desktop. The name of the PDF is just the name of the excel file. I found that if the button is pushed twice without moving or renaming the PDF after the first push I get an error.
How would I enable a user to choose the location and name for the PDF?
The code:
Code:
Sub Button2336_Click()
'
' Button2336_Click Macro
'
'
ChDir "C:\Users\" & Environ("Username") & "\desktop\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=filesavename, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
Thanks for any help!