MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 15th, 2002, 09:04 AM   #1
Tom Urtis
MrExcel MVP
 
Tom Urtis's Avatar
 
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,387
Default

Hello all,

Does this happen to anyone, 'cause it's happened to me. Some (a relative few, but enough to bug me) of my workbooks remain listed in the VBA Project Explorer even after I close them. It's odd, because just looking at the VBA PE, if you didn't otherwise know that the file was closed, you'd think it was open. When this occurs, I can view all the sheet objects and macros in the PE just as if the file was still open. Then, if I re-open the actual file (without rebooting inbetween), the file will appear listed twice in the PE.

This has happened to me on different OS's (98, NT, etc), in Excel2000. It seems to happen with files that contain a Workbook_Open event, especially when that open procedure involves opening another Excel file in order to import data.

Am I missing something obvious, maybe with my Close event, to convince Excel that it should now remove this file project from the Project Explorer? Any advice?

Thanks!!!

Tom Urtis
__________________
Tom Urtis
Microsoft MVP - Excel
Tom Urtis is offline   Reply With Quote
Old Mar 15th, 2002, 09:16 AM   #2
MrExcel
.
 
MrExcel's Avatar
 
Join Date: Feb 2002
Location: Akron, Ohio USA
Posts: 789
Default

That is bizarre. I've never seen it.

Do you mean that you can still view the macros, or just the list of modules?

If you can still see the code in the macros, - what would happen if you change a macro and try to click on the Save icon in VBE? Do you get a horrific crash and burn? Does it appear to save? Or just nothing?

What does the code look like in your Before_Close event?

Bill

_________________
MrExcel.com Consulting

[ This Message was edited by: MrExcel on 2002-03-15 08:17 ]
MrExcel is offline   Reply With Quote
Old Mar 15th, 2002, 09:20 AM   #3
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

I tried to duplicate your problem, but can't get it.

Are the worksheets visible when you open them? i.e. are you instantiating an XL object using something like:



Dim XL as object

Set XL = CreateObject("Excel.Application")
etc.


(I don't expect that code to work since I just pulled it out of my *** and only use it as an example.)

Or do you open these workbooks using something like:


Workbooks.Open "C:TempBook1.xls"



I had a similar problem to you a few years ago in Excel 97 SR-2 on Win NT4, but the problem "went away" when I upgraded to Excel 2000. (The fact that you're using 2000 makes me scratch my head some more).

_________________
[b] Mark O'Brien

[ This Message was edited by: Mark O'Brien on 2002-03-15 08:24 ]
Mark O'Brien is offline   Reply With Quote
Old Mar 15th, 2002, 09:49 AM   #4
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Tom
These workbooks haven't by any chance been
used as a server ie. used to connect to
the internet....??

I know there can be issues when using IE


Ivan
Ivan F Moala is offline   Reply With Quote
Old Mar 15th, 2002, 10:31 AM   #5
Tom Urtis
MrExcel MVP
 
Tom Urtis's Avatar
 
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,387
Default

Thanks Bill, Mark, and Ivan for the responses. Answers to your questions:

Bill:
When this happens, I can view the macro and "edit" it, but I've never had the nerve to save it in the VBE and risk a crash; frankly I've been too timid to try the experiment. What I have done, is to try running a macro from the file when I open it a second time, but (and this is really wierd) the macros do not run, nor are they listed in the Macro Name box where you'd ordinarily see them via Tools > Macro > Macros (Alt+F8). Though, the file project name is then listed twice in the VBE PE. So I close out Excel and re-open the file, but then the same problem persists. There's a follow up to this, 4 paragraphs down.

My Before_Close events seem innocuous. Most of my clients have many end users who impose splits, or pane freezes, or gridlines for their own temporary viewing preference, but which annoys their colleagues if left that way after closing, so I usually involve a restoration of the windows' original fresh look for the next user to alter as they like, with an autosave.

Mark:
This has never happened while an XL object was created as you described. Sometimes my apps have hidden sheets, sometimes not.

Ivan:
Thanks, good idea, but unfortunately in my case I was not using Excel in that capacity.

The good news is, this is a rare occurrence, having happened to me maybe half a dozen times over the years, but most recently last week on a job site. That time, the procedure was in a Workbook_Open event, and to work around the problem, I placed the code into a regular module, to be triggered by a Forms button, and deleted the Workbook_Open event altogether, as the procedure's purpose was to import data. I had no problems thereafter with the file, but it wasn't as sharp as it could've been, because the import was not truly automatic; it required a button click action from the user, which to me reduced the convenience factor for the client.

This situation is not happening to me at the moment, but I'm being a little proactive today for if/when it does, and how to avoid it.

Thanks again for your ideas; much appreciated. If I find a cause and/or solution, I'll be sure to post it in case anyone else has experienced this.
__________________
Tom Urtis
Microsoft MVP - Excel
Tom Urtis is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:05 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes