Solved

Open the SaveAs dialog with VBA in Excel

Posted on 2011-03-10
4
764 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 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now