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 May 6th, 2002, 11:16 AM   #1
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Hey,

I've just been sent a macro diseased workbook from a vendor. It was originally created in Excel 5.0/95 and uses the "AUTO_OPEN" doo hicky.

My question is this. Obviously AUTO_OPEN is supported in XL2000 (which is what I've got) in some fashion for backward compatibility.

As an example, say I didn't want to put any code in the worksheets or workbook objects. If I were to use AUTO_OPEN instead of the Workbook Open event, would I have to save the workbook in Excel 95 format. (it appears that AUTO_OPEN can be in any module and will still work. I'm also too busy to mess around with it just now)

Additional question, does anyone use this sort of thing to keep their workbook free of code?

PS. Yes, for a substantial discount on their equipment, I have offered the vendor my expertise to modernise their workbook.
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old May 6th, 2002, 11:43 AM   #2
Damon Ostrander
MrExcel MVP
 
Damon Ostrander's Avatar
 
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
Default

Hi Mark,

The Auto_Open will work whether the workbook is saved as version 5.0 or 2000. There are a couple arguments for switching over to Workbook events rather than the Auto_Open:

1. who knows how much longer Auto_Open will continue to be supported since it is an archaic feature. Microsoft is encouraging developers to switch from Auto_Open to the Open event;

2. someone may try to add an Open event macro to the workbook without being aware of the Auto_Open, and the result could be code that conflicts;

3. obviously, using Auto_Open does not keep the workbook free of code, since the standard code module containing the Auto_Open is stored with the workbook as well.

All that said, I should also mention that there are some bugs still remaining in the worksheet/workbook events. If you encounter one of these it can sometimes be eliminated by reverting to the old Excel 5 Auto_Open type event routines. Usually these bugs are fairly obvious so you would know if you had one.
__________________
Keep Excelling.

Damon

VBAexpert Excel Consulting
(My other life: http://damonostrander.com )
Damon Ostrander is offline   Reply With Quote
Old May 6th, 2002, 11:58 AM   #3
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi,

I have heard of only one advantage to using the Auto_Open rather than the Workbook_Open event. Naturally it came out of *yet another* small spat between Harlan Grove and an Excel MVP. This time it is Rob Bovey.

The following is the original thread:

http://groups.google.com/groups?hl=e...rldnet.att.net

Here, when there is interaction between Excel and another program/application (a PERL controller in this case), occasionally Excel needs to "tidy up" a bit before opening fully and occasionally the open event happens before that clean up.

Now, I may be misinterpreting what Rob is saying, but the post was from 2002, so Rob definitely is aware of the workbook_open event, and I believe it is a clear decision to go to the auto_open here.

That said, Damon makes excellent points and the benefits seem to outweigh this one drawback by a considerable margin.

Bye,
Jay

EDIT: On second thought, I think that a worksheet_open event will work, with Rob's suggestion to wait a bit before calling a routine, rather than just calling the routine directly.

[ This Message was edited by: Jay Petrulis on 2002-05-06 11:00 ]
Jay Petrulis is offline   Reply With Quote
Old May 6th, 2002, 12:03 PM   #4
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Thanks guys.

Yeah, I was actually going to ask if XP still supported this feature. Usually I wouldn't expect too much backward compatibility after 3 versions.

Obviously I wouldn't want to use this unless it's absolutely necessary and would only use it in versions that knew that it worked in. (and the question was more for future reference, should I ever need to use it)

I was thinking that it's easier to strip/export standard modules from workbooks than from the worksheet and workbook objects. This would be one advantage I could see.

Anyway, thanks again.
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien 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 07:23 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