ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as new file without changing existing file (https://www.excelbanter.com/excel-programming/383294-save-new-file-without-changing-existing-file.html)

mcphc

Save as new file without changing existing file
 
Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton

Ron de Bruin

Save as new file without changing existing file
 
You can use SaveCopyAs with code to save the file in the folder you want and with the name you want

ThisWorkbook.SaveCopyAs "C:\Data\yourfilename.xls"




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"mcphc" wrote in message ...
Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton



mcphc

Save as new file without changing existing file
 
Unfortuantly what I want is not that simple.

I basically want a macro that works just like an auto save works. So if I
run the macro a file "B.xls" is saved which is a snap shot of what the file
"A.xls" currently is. Then if I close file "A.xls" I am still asked if I
would like to save my changes before closing.

"Joel" wrote:

The easy way to get back the old file is simply go to the File menu and look
for the old filename at the bottom of the menu.

"mcphc" wrote:

Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton


Ron de Bruin

Save as new file without changing existing file
 
Try it

Note: I use SaveCopyAs and not SaveAs

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"mcphc" wrote in message ...
Unfortuantly what I want is not that simple.

I basically want a macro that works just like an auto save works. So if I
run the macro a file "B.xls" is saved which is a snap shot of what the file
"A.xls" currently is. Then if I close file "A.xls" I am still asked if I
would like to save my changes before closing.

"Joel" wrote:

The easy way to get back the old file is simply go to the File menu and look
for the old filename at the bottom of the menu.

"mcphc" wrote:

Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton



mcphc

Save as new file without changing existing file
 
Don't worry just found the solution

ActiveWorkbook.SaveCopyAs "C:\B.XLS"


"mcphc" wrote:

Unfortuantly what I want is not that simple.

I basically want a macro that works just like an auto save works. So if I
run the macro a file "B.xls" is saved which is a snap shot of what the file
"A.xls" currently is. Then if I close file "A.xls" I am still asked if I
would like to save my changes before closing.

"Joel" wrote:

The easy way to get back the old file is simply go to the File menu and look
for the old filename at the bottom of the menu.

"mcphc" wrote:

Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton


joel

Save as new file without changing existing file
 
The easy way to get back the old file is simply go to the File menu and look
for the old filename at the bottom of the menu.

"mcphc" wrote:

Lets say an excel file A.xls has been opened and has had some changes made
to it but not saved. Is it possible in VBA to save this file as B.xls
including the changes and have file A.xls still open in excel so that if
the file were to be closed you could still select to save the changes or not?

Thanks

Clayton



All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com