The problem being solved in CLOSE01.XLS is the following:
You have written and installed an Excel system for your end users.
The system can, of course, be started from within Excel as well as from an icon on the desktop.
BUT: what happens if your user already has one or more (say 10 of them just to be on the safe side!) of his/her
own workbooks open in Excel when your system starts up? Think about the consequences:
What is the screen going to look like while your subs execute?
How much of Excel's
memory space is going to be used to hold the user's books (presumably to no useful purpose)?
Do you
loop through the Workbook collection in your code, assuming that only "your" Workbooks are open?
You get the idea. A bunch of already open user books that are extraneous to your system can create a real mess.
CLOSE01.XLS contains a single Sub which demonstrates and explains a method for shutting down these user Workooks when your system starts.The best place to do this is probably from your Auto_open.
The ZIP archive CLOSE01.ZIP contains CLOSE01.XLS. You can easily modify the sub to suit your own needs.
Your cost: 0. My liability: 0.
Please let me know if you download it, use it, find any bugs in it, get any mileage out of it, improve it. It works. Enjoy.
Sign The Fortress Guestbook
, while you're at it.