Link to home
Start Free TrialLog in
Avatar of hthart
hthartFlag for United States of America

asked on

Open the SaveAs dialog with VBA in Excel

From Excel, I have written VBA code that will save a file with a predetermined filename.  

If that filename already exists, I need VBA to open the SaveAs dialog window and supply a suggested filename.

How do I open the SaveAs dialog with VBA code?

Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

application.dialogs(xlDialogSaveAs).Show "C:\test"

Open in new window

you can add a filename as well if required.
Avatar of hthart

ASKER

This works great, but I also need it to default the Save as Type combobox toshow *.xls.

Is that possible?
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hthart

ASKER

It is absolutely perfect!

Thank you