Save As Filename

D

Dow

I have looked through every post I could find related to this and I am
not seeing what I need. I hope someone will be able to help me.

I have written a combination of macros that make some format changes
to a workbook then add some formulas and finally I get a finished
product.

Halfway through the macros I want to insert code or another macro that
will save the workbook at that point, with it's current name, to a
fixed location, and then continue working to finish the rest of the
formulas and equations. I will save the finished product with a
different name in a different location.

I can then use the originally saved file with the formating done up to
that point for something else.

Does anyone have any thoughts on how to do this? I have been looking
at getfilesaveas and a number of other things but I am not able to
make them work for what I want.

Thanks as always.

Dow.
 
J

Joel

You need to perform the saveas and then open the original workbook back up

set bk1 = activeworkbook
'get pathaname of original file
bkname = bk1.fullname

'make c hange to original workbook

'save changes as new workbook.
bk1.saveas filename:="c:\temp\book2.xls"
'the original workbook is closed during the saveas

'open original workbook without modifications
'modifications got saved as in new book
set bk2 = workbooks.open(filename:=bkname)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top