Macro to close workbook and re-open new copy

Macro to close workbook and re-open new copy

Post by RGF2ZSBMYW » Fri, 02 Mar 2007 06:31:08


I have a multiple page workbook we use to enter in activation information - a
different page for each of 3 types of activations. When you choose to save
it (macro) it asks for a reference number and saves the page using the
reference number as the file name. That all works great.

I now need to close the original file and re-open it so that the data is
cleared. How can I do this because as soon as I close it the macros cease to
work.
--
Dave Lagergren
Manager - Data Applications
Wireless Management, Inc
Specializing in cellular wireless applications
 
 
 

Macro to close workbook and re-open new copy

Post by Dave Peter » Fri, 02 Mar 2007 07:11:18

Maybe your code could use:
activeworkbook.savecopyAs filename:="somepath\whateveryouwant.xls"

Then you could either clean up the cells you need to clean up--or even ask.
Maybe the user would want to keep the existing values for a project that's
similar.





--

Dave Peterson

 
 
 

Macro to close workbook and re-open new copy

Post by Dave Peter » Fri, 02 Mar 2007 07:11:48

And since the code is in the same workbook, you'd probably want to use:
thisworkbook.savecopyas ....





--

Dave Peterson