Excel VBA Save As without leaving current Workbook

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Excel VBA Save As without leaving current Workbook

Post by Rudi »

Hi,

Is there an elegant way of saving the current workbook as a new file in a specific location, without it becoming the new saved as workbook? I want a copy placed in a specific location but the original file must be kept active. Alternatively, save as, close the new saved workbook and reopen the original workbook; however this way stops the code execution which was in the original file (since it is now closed).

TX
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78230
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Excel VBA Save As without leaving current Workbook

Post by HansV »

The Workbook has a SaveCopyAs method:

Code: Select all

    ActiveWorkbook.SaveCopyAs "C:\OtherFolder\OtherFile.xlsm"
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Excel VBA Save As without leaving current Workbook

Post by Rudi »

Nah.... :bingo:
As simple as that!!!! :drop:

TX
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.