Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All -
I don't understand the differences between Auto_open and Workbook_beforeOpen, or those for their closing brethern. Why should one be preferred over the other? Why are there two thigns that do the same intent? ....best, Hash |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Look at Chip Pearson's discussion (summary - one is old, one is new)
http://www.cpearson.com/excel/events.htm -- Regards, Tom Ogilvy wrote in message news:FYwQd.65995$2p.5631@lakeread08... All - I don't understand the differences between Auto_open and Workbook_beforeOpen, or those for their closing brethern. Why should one be preferred over the other? Why are there two thigns that do the same intent? ...best, Hash |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Workbook_Open will take precedence over Auto_Open. Auto_Open is only provided for backward compatibility and will not fire when a workbook is opened via code. VBA provides a RunAutoMacros method of the workbook which allows the Workbook_Open event to fire when a workbook is opened via code. The Workbook _Open event is contained in the ThisWorkbook Class of a workbook, whereas the Auto_Open macro is contained in a standard Module. I'm assuming you meant Workbook_Open as opposed to Workbook_BeforeOpen as AFAIK this event doesn't exist. I don't see how it could. Hope this clears it up for you. Cheers, O -- Message posted via http://www.officekb.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Workbook_Open will take precedence over Auto_Open. Auto_Open is only
provided for backward compatibility and will not fire when a workbook is opened via code Just to add, Both Workbook_Open and Auto_Open would run if opened manually. RunAutoMacros is a command you can use to run the Auto_Open macro (or Auto_Close macro) as part of the same code that opens (or closes) the workbook. the Workbook_Open macro runs whether the workbook is opened with code or manually provided Events (an application level setting) are not disabled. BeforeClose and Auto_close have a similar relationship. -- Regards, Tom Ogilvy "Oliver Ferns via OfficeKB.com" wrote in message ... Hi, Workbook_Open will take precedence over Auto_Open. Auto_Open is only provided for backward compatibility and will not fire when a workbook is opened via code. VBA provides a RunAutoMacros method of the workbook which allows the Workbook_Open event to fire when a workbook is opened via code. The Workbook _Open event is contained in the ThisWorkbook Class of a workbook, whereas the Auto_Open macro is contained in a standard Module. I'm assuming you meant Workbook_Open as opposed to Workbook_BeforeOpen as AFAIK this event doesn't exist. I don't see how it could. Hope this clears it up for you. Cheers, O -- Message posted via http://www.officekb.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oliver -
Thanks. Yes, I got the wrong name. Next version of Excel will anticipate what spreadsheet we want opened. ;-) It'll be a feature. It particularly helps about where the code goes. ....best, Hash In article , "Oliver Ferns via OfficeKB.com" wrote: Hi, Workbook_Open will take precedence over Auto_Open. Auto_Open is only provided for backward compatibility and will not fire when a workbook is opened via code. VBA provides a RunAutoMacros method of the workbook which allows the Workbook_Open event to fire when a workbook is opened via code. The Workbook _Open event is contained in the ThisWorkbook Class of a workbook, whereas the Auto_Open macro is contained in a standard Module. I'm assuming you meant Workbook_Open as opposed to Workbook_BeforeOpen as AFAIK this event doesn't exist. I don't see how it could. Hope this clears it up for you. Cheers, O |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In article ,
"Tom Ogilvy" wrote: Look at Chip Pearson's discussion (summary - one is old, one is new) http://www.cpearson.com/excel/events.htm Tom - Second round of thanks. ....best, Hash |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
AUTO_OPEN | Excel Discussion (Misc queries) | |||
Help with 'Auto_Open' please... | Excel Discussion (Misc queries) | |||
auto_open? | Excel Discussion (Misc queries) | |||
XLA auto_open | Excel Programming | |||
Beyond AUTO_OPEN | Excel Programming |