Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Open, then Close another File HROBERTSON Excel Discussion (Misc queries) 1 January 8th 07 06:41 PM
VBA Code to kick off macro when workbook command to close is initi zulfer7 Excel Discussion (Misc queries) 2 June 23rd 06 08:04 PM
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM
run macro on workbook close Nigel Excel Discussion (Misc queries) 3 November 29th 05 08:48 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"