Microsoft KB Archive/294810

= XL2000: Workbook_Activate Event Does Not Fire When Driven Programmatically =

Article ID: 294810

Article Last Modified on 10/10/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q294810



SYMPTOMS
When you close a workbook programmatically, the Workbook_Activate event is not triggered for the next open workbook that Excel activates.



CAUSE
Workbook and worksheet events are not designed to run when Excel is being controlled programmatically.



RESOLUTION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this behavior, call the Workbook_Activate event from the code that closes the active workbook, for example: Sub Launch_workbook_event

' The (1) is the index number for the first opened workbook. ' You can use the specific workbook name instead.

Workbook(1).Activate

ThisWorkbook.Close

End Sub

Keywords: kbinfo KB294810

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.