ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detect workbook events from .XLA (https://www.excelbanter.com/excel-programming/280693-detect-workbook-events-xla.html)

Conceptor[_2_]

Detect workbook events from .XLA
 
Hi,

I am trying to migrate all code from a .xls file to
a .xla file for maintainability purposes. The original
code, when it was in the .xls file, was triggered from
workbook events like Workbook_Open. In the new .xla file,
the Workbook_Open event triggers only when the .xla file
opens, not when other .xls files are opened. I need to
access the events of every opened workbooks in the excel
session *from the .xla file* to make the code run
correctly.

As I noticed, the .xla itself act like it was a workbook
and every events I can catch from there are the .xla's own
workbook events. I need to get events from all other
opened workbooks as well. How can I achieve this?

Thanks in advance.

C.

Harald Staff

Detect workbook events from .XLA
 
Hi C

See if Chip's code at http://www.cpearson.com/excel/AppEvent.htm is useful for you.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Conceptor" wrote in message
...
Hi,

I am trying to migrate all code from a .xls file to
a .xla file for maintainability purposes. The original
code, when it was in the .xls file, was triggered from
workbook events like Workbook_Open. In the new .xla file,
the Workbook_Open event triggers only when the .xla file
opens, not when other .xls files are opened. I need to
access the events of every opened workbooks in the excel
session *from the .xla file* to make the code run
correctly.

As I noticed, the .xla itself act like it was a workbook
and every events I can catch from there are the .xla's own
workbook events. I need to get events from all other
opened workbooks as well. How can I achieve this?

Thanks in advance.

C.




David Hager[_2_]

Detect workbook events from .XLA
 
Under Visual Basic Help, see Using Events with the Application Object.

The event procedure you need is App_WorkbookOpen.

David Hager
Excel MVP

"Conceptor" wrote in message
...
Hi,

I am trying to migrate all code from a .xls file to
a .xla file for maintainability purposes. The original
code, when it was in the .xls file, was triggered from
workbook events like Workbook_Open. In the new .xla file,
the Workbook_Open event triggers only when the .xla file
opens, not when other .xls files are opened. I need to
access the events of every opened workbooks in the excel
session *from the .xla file* to make the code run
correctly.

As I noticed, the .xla itself act like it was a workbook
and every events I can catch from there are the .xla's own
workbook events. I need to get events from all other
opened workbooks as well. How can I achieve this?

Thanks in advance.

C.





All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com