Hi:
Looking to save a Userform as a PDF when user clicks a command button. Here's what I was able to find on the net but nothing for a User form:
I suspect the error is on the last line since I changed "Worksheet" to "UserFrom".
Any help appreciated...
Looking to save a Userform as a PDF when user clicks a command button. Here's what I was able to find on the net but nothing for a User form:
HTML:
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
fName = TextBox1.Value
newFile = fName & " " & Format$(Date, "mm-dd-yyyy")
' Change directory to suit
ChDir _
"D:\My Documents\Desktop"
UserForm.ExportAsFixedFormat xlTypePDF, Filename:=newFile
I suspect the error is on the last line since I changed "Worksheet" to "UserFrom".
Any help appreciated...