LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Closing Within Macros

I am creating a macro to do some pretty wacky filtering. Some of the ways
That I have it doing it is through pasting onto new workbooks. SO, after
I've reached the end result (which it seems to be working nicely) I have two
extra documents open and I wanted to incorporate into my macro to close them
automatically. I went ahead and recorded a macro of closing those two
documents, and this is what it looked like:

Windows("Book1").Activate
ActiveWindow.Close
Windows("Original Filename").Activate
ActiveWindow.Close

Which effectively leaves me on Book 2 with the finished product. SO, I just
want everything else to close. That above formula would work nicely on the
file it was recorded for, BUT, when I go to use this macro on new documents
and data, it won't work the same because the original filename will be
different. Any ideas??? Thanks!!!


 
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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Error closing Excel after running series of macros PT_VBA_GRRL[_2_] Excel Programming 1 January 25th 06 09:20 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM


All times are GMT +1. The time now is 06:57 AM.

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

About Us

"It's about Microsoft Excel"