How to open the SAVE AS dialog box with VBA?

peter_z

Board Regular
Joined
Feb 27, 2011
Messages
87
Hey Guys,
Just wondering if anyone knows how to use VBA to open the save as dialog box?

I would like for the end user to be able to save the file and name the file to what ever they want.

Cheers for the help!
Peter
 
I have the below which is working perfectly - it opens up the Save As dialog box, enters a file name, and selects PDF as the file type.. I would like to adjust slightly to include the range of cells to PDF print, rather than the predefined print area. Any ideas? It's surely a simple little adjustment but my attempts have failed despite trying to use ideas from mikerickson as above.

Sub SaveAsPDF()
Application.Dialogs(xlDialogSaveAs).Show Range("A33") & " " & Range("C33"), 57

End Sub
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
The range of cells that form a PDF are not part of the SaveAs dialog. Set the ActiveSheet.PageSetup.PrintArea just before calling this and you should be fine.
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,084
Members
453,021
Latest member
Justyna P

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