From: Kim on
Using Excel 2007, I have a macro where I use a workbook, then save as a new
named workbook. I want to keep the original workbook open. What code
language will accomplish this? Even manually, I do not see how to save as a
copy and keep original file open.

Thank you
From: Luke M on
Correct, when you save-as, you are changing the name of active file, not
creating a copy. Perhaps this code?

Sub ReName()
xName = ActiveWorkbook.FullName
'Change this to something appropriate
ThisWorkbook.SaveAs "New Name"
'Opens original file
Workbooks.Open (xName)
'Close the copied file
ThisWorkbook.Close
End Sub


--
Best Regards,

Luke M
"Kim" <Kim(a)discussions.microsoft.com> wrote in message
news:809F038B-AC13-405E-8C60-69139E3525F0(a)microsoft.com...
> Using Excel 2007, I have a macro where I use a workbook, then save as a
> new
> named workbook. I want to keep the original workbook open. What code
> language will accomplish this? Even manually, I do not see how to save as
> a
> copy and keep original file open.
>
> Thank you


From: Dave Peterson on
Look at SaveCopyAs in VBA's help.

Kim wrote:
>
> Using Excel 2007, I have a macro where I use a workbook, then save as a new
> named workbook. I want to keep the original workbook open. What code
> language will accomplish this? Even manually, I do not see how to save as a
> copy and keep original file open.
>
> Thank you

--

Dave Peterson
From: Gary Brown on
You need to re-open the original.
Prior to save as, put the current name in a variable.
After the save as, open the original using that variable.

Something like...

strOriginalName = ActiveWorkbook.FullName
....save as code
Workbooks.Open Filename:= strOriginalName

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Kim" wrote:

> Using Excel 2007, I have a macro where I use a workbook, then save as a new
> named workbook. I want to keep the original workbook open. What code
> language will accomplish this? Even manually, I do not see how to save as a
> copy and keep original file open.
>
> Thank you
From: Harald Staff on
SaveCopyAs

HTH. Best wishes Harald

"Kim" <Kim(a)discussions.microsoft.com> wrote in message
news:809F038B-AC13-405E-8C60-69139E3525F0(a)microsoft.com...
> Using Excel 2007, I have a macro where I use a workbook, then save as a
> new
> named workbook. I want to keep the original workbook open. What code
> language will accomplish this? Even manually, I do not see how to save as
> a
> copy and keep original file open.
>
> Thank you

 |  Next  |  Last
Pages: 1 2
Prev: IF Statement or VLOOKUP
Next: Scales on Charts.