letswriteafairytale
New Member
- Joined
- Dec 23, 2024
- Messages
- 12
- Office Version
- 365
- Platform
- Windows
I have been working on creating some templates for office use on a network server for a while, and have played with MANY different ways to do what I would like to achieve.
I've come to the conclusions of using UserForms and custom buttons. I've found a code that kind of does what I need, but not exactly.
My 2 buttons are "Save as .xlsm" & "Save as .pdf"
What I would like for those 2 buttons to do are, open the save as dialog, but only have the chosen file type, and let the person pick a folder and name it themselves.
I found a few codes that I've tried adjusting and editing to get what I want, but I am just struggling. This is the one for the PDF that will work, IF I can get a code for the .xlsm to work first(we save as xlsm before it is reviewed & finalized as a PDF, so I don't NEED to re-name the PDF if the xlsm is correct)
This is the XLSM sub that I need help with:
I've come to the conclusions of using UserForms and custom buttons. I've found a code that kind of does what I need, but not exactly.
My 2 buttons are "Save as .xlsm" & "Save as .pdf"
What I would like for those 2 buttons to do are, open the save as dialog, but only have the chosen file type, and let the person pick a folder and name it themselves.
I found a few codes that I've tried adjusting and editing to get what I want, but I am just struggling. This is the one for the PDF that will work, IF I can get a code for the .xlsm to work first(we save as xlsm before it is reviewed & finalized as a PDF, so I don't NEED to re-name the PDF if the xlsm is correct)
VBA Code:
Private Sub Save_as_PDF()
Dim Fldr As String
With Application.FileDialog(4)
.AllowMultiSelect = False
If .Show Then Fldr = .SelectedItems(1)
End With
With ActiveSheet
.ExportAsFixedFormat xlTypePDF, Fldr & "\" & .Name, , , 1, , , 0
End With
End Sub
This is the XLSM sub that I need help with:
VBA Code:
Private Sub Save_as_XLSM()
End Sub