?
Solved

Open the SaveAs dialog with VBA in Excel

Posted on 2011-03-10
4
Medium Priority
?
846 Views
Last Modified: 2012-05-11
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?

0
Comment
Question by:hthart
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35096513
application.dialogs(xlDialogSaveAs).Show "C:\test"

Open in new window

you can add a filename as well if required.
0
 

Author Comment

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

Is that possible?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 35096790
Try adding ,1 to the end:
application.dialogs(xlDialogSaveAs).Show "C:\test", 1

Open in new window

0
 

Author Closing Comment

by:hthart
ID: 35096823
It is absolutely perfect!

Thank you
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question