Ellendigitl00
New Member
- Joined
- Oct 23, 2024
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hello all,
I'm having some trouble with my VBA Userform: I want to upload a pdf file to my Userform, rename it and then save that pdf to a specific folder in my computer.
What I have is:
Private sub SaveButton_click()
'save file to PDF
Path = "directory"
FileName = Data.Value & "_" & Description.Value & "_" & ".pdf"
ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=Path, _
OpenAfterPublish:=True
MsgBox ("Note: This file is now saved with the name of " & FileName & " in " & Path & ".")
End Sub
Private Sub Upload_file_Click()
Dim result As Variant
result = Application.GetOpenFilename("PDF Files (*.pdf), *.pdf")
End Sub
I think my problem is with the fuction ExportAsFixedFormat Type, because the Userform is trying to export something that doesn't exist in Workbook.... Does anybody know this?
Thanks in advance!
I'm having some trouble with my VBA Userform: I want to upload a pdf file to my Userform, rename it and then save that pdf to a specific folder in my computer.
What I have is:
Private sub SaveButton_click()
'save file to PDF
Path = "directory"
FileName = Data.Value & "_" & Description.Value & "_" & ".pdf"
ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=Path, _
OpenAfterPublish:=True
MsgBox ("Note: This file is now saved with the name of " & FileName & " in " & Path & ".")
End Sub
Private Sub Upload_file_Click()
Dim result As Variant
result = Application.GetOpenFilename("PDF Files (*.pdf), *.pdf")
End Sub
I think my problem is with the fuction ExportAsFixedFormat Type, because the Userform is trying to export something that doesn't exist in Workbook.... Does anybody know this?
Thanks in advance!