Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to close workbook and re-open new copy
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to close workbook and re-open new copy
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 Lagergren wrote: 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 -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to close workbook and re-open new copy
And since the code is in the same workbook, you'd probably want to use:
thisworkbook.savecopyas .... Dave Lagergren wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Open, then Close another File | Excel Discussion (Misc queries) | |||
VBA Code to kick off macro when workbook command to close is initi | Excel Discussion (Misc queries) | |||
Macro to open workbook and copy and paste values in to orig workbo | Excel Worksheet Functions | |||
run macro on workbook close | Excel Discussion (Misc queries) | |||
How can I close only 1 workbook when I have many open? | Excel Discussion (Misc queries) |