I have a button in excel to convert to pdf and then save different locations

ojabba1

New Member
Joined
Aug 25, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have been currently using a VBA code that I recorded to save my excel work sheet as PDF in a specific location, I now want others to use also. How can I change the code to prompt users to use save as? So they save in a location that is not predetermined by me.

Sub SaveSend()
'
' SaveSend Macro
'

'
Sheets("Tool Box # 19").Unprotect ("q")
c00 = "C:\Users\johna\Coastal Computer Medics\After Sales Service - Perry Construction Folder\WH&S\Saved Tool Box Talks\2021 records\"
With Sheets("Tool Box # 19")
.ExportAsFixedFormat xlTypePDF, c00 & .Range("B6") & " " & .Range("H8") & " " & " (" & Format(Now, "dd-mm-yyyy") & ")" & ".pdf", , , , , , True
End With



End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
How about replacing:

VBA Code:
c00 = "C:\Users\johna\Coastal Computer Medics\After Sales Service - Perry Construction Folder\WH&S\Saved Tool Box Talks\2021 records\"

with:

VBA Code:
        Application.FileDialog(msoFileDialogFolderPicker).Show
        c00 = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1) & "\"
 
Upvote 0
Solution
How about replacing:

VBA Code:
c00 = "C:\Users\johna\Coastal Computer Medics\After Sales Service - Perry Construction Folder\WH&S\Saved Tool Box Talks\2021 records\"

with:

VBA Code:
        Application.FileDialog(msoFileDialogFolderPicker).Show
        c00 = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1) & "\"
Great that works fantastic.
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top