Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto_open vs workbook_open

Status
Not open for further replies.

christhedonstar

Programmer
Apr 9, 2007
215
GB
Hi,

Please can someone confirm and highlight differences between auto_open vs workbook_open

1) auto_open is a special sub that excel will run when a workbook is open
2) auto_open runs before workbook_open
3) auto_open doesn't require all the dlls/xlls or xlas to exist in order for the code in it to run.
4)auto_open behaviour above is the same in Excel 2002/2003 and 2007?

Thanks,

Chris
 
1) Yes
2) No - workbook open runs 1st
3) ??? Only real difference between auto_open and workbook_open is the timing of when they run and teh fact that workbook_open is an event speicifically associated with the workbook object
4) Don't know about 2007 but I see no reason for MS to change their policy. Auto_open was made redundant in 2000 as it was replaced with workbook_open. Every version since then has included it for backwards compatability - I see no reason why 2007 should be any different

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
One other difference is that when a workbook is opened from code, the Workbook_Open event will fire, but the Auto_Open will not unless it is included in the code that opens the workbook (i.e. Application.Workbooks(x).RunAutoMacros xlAutoOpen)

There should be no real reason to use Auto_Open anymore though.

Cheers,

Roel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top