Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force Save over existing file XCESIV[_18_] Excel Programming 3 May 25th 06 08:51 AM
Existing file not defaulting to same location using "Save As" Daniel918 Excel Discussion (Misc queries) 1 June 1st 05 12:55 AM
can i save an existing .xls file as a .csv file using command line craigkan Excel Discussion (Misc queries) 2 February 18th 05 02:01 PM
get path - save new file - same sub-directory as existing file tegger Excel Programming 2 October 21st 03 10:45 AM
Automatically replace existing file on save ronber[_2_] Excel Programming 1 September 25th 03 10:05 PM


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"