Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Auto_Open vs. Workbook_beforeopen?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto_Open vs. Workbook_beforeopen?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Auto_Open vs. Workbook_beforeopen?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto_Open vs. Workbook_beforeopen?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Auto_Open vs. Workbook_beforeopen?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Auto_Open vs. Workbook_beforeopen?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AUTO_OPEN Bob Barnes Excel Discussion (Misc queries) 2 February 6th 08 03:03 AM
Help with 'Auto_Open' please... cdavidson Excel Discussion (Misc queries) 3 November 14th 05 04:53 PM
auto_open? Jack Sons Excel Discussion (Misc queries) 0 February 22nd 05 09:16 PM
XLA auto_open jc Excel Programming 0 October 6th 04 12:50 AM
Beyond AUTO_OPEN WarrenR Excel Programming 2 February 27th 04 03:57 AM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"