Solved

Open the SaveAs dialog with VBA in Excel

Posted on 2011-03-10
4
803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

707 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