Performing a SaveAs with VB

mlopes1

Board Regular
Joined
Jul 14, 2002
Messages
114
I am creating a button on a workbook that is displayed on a custom toolbar. The workbook is a template. All I would like for that button to do is perform a saveas.
I have this code:

Application.Dialogs(xlDialogSaveAs).Show

Let's say for example, that the first time I am on the template, I hit the button and save a file called 'test.xls'. Then, for whatever reason, someone no longer needs 'test.xls' so they delete it. The next time the saveas button is hit on the original template, I receive an error stating that 'test.xls' could not be found etc etc. Why is it looking for the last saveas and how can I get it to stop doing this? Thanks in advance.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,203,461
Messages
6,055,559
Members
444,798
Latest member
PAO1609

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