Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Auto_Open Vs Workbook_open

Hi all,

what difference it makes having code under Auto_open or
under Workbook_open

TIA

Soniya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Auto_Open Vs Workbook_open

Soniya,

Workbook_Open is an "event" that "fires" whenever a workbook
is opened.
Auto_Open is a "sub" that Excel recognizes and runs when a workbook
is opened.
The main difference is that the Workbook_Open "event" fires whether
the workbook is opened manually or via code (from another workbook).
The Auto_Open will only run when the workbook is opened manually.

John

Soniya wrote:

Hi all,

what difference it makes having code under Auto_open or
under Workbook_open

TIA

Soniya


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Auto_Open Vs Workbook_open

Hi Soniya..


workbook_open runs first and auto_open next

When you open a book manually:
BOTH will run UNLESS you keep SHIFT key pressed.

When you open a book with vba:
the auto_open WILL NOT run UNLESS you add the line (after open)
ActiveWorkbook.RunAutoMacros xlAutoOpen

the workbook event code WILL run UNLESS you add (before open)
Application.EnableEvents = FALSE

I think Auto_open was left in for backward compatibility with excel4
macros. Personally I'd use Workbook_Open


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Soniya" wrote:

Hi all,

what difference it makes having code under Auto_open or
under Workbook_open

TIA

Soniya


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
Private Sub Workbook_Open() doesn't run Steve Starr Excel Discussion (Misc queries) 4 April 3rd 11 05:05 AM
Breaking into Workbook_Open Bob Barnes Excel Discussion (Misc queries) 2 July 29th 09 10:45 PM
About workbook_Open madro Miguel Angel Excel Worksheet Functions 0 November 2nd 06 12:00 PM
Workbook_Open() Event Bill Martin Excel Discussion (Misc queries) 9 January 13th 06 08:24 PM
Workbook_Open () Bill Martin Excel Discussion (Misc queries) 12 December 20th 05 05:37 PM


All times are GMT +1. The time now is 10:44 AM.

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

About Us

"It's about Microsoft Excel"