Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to know how to initiate a workbook event from a subroutine. It seems like it should be something like Call Workbook_Open Thanks, Matt |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are two general approaches:
1. Use the Context Say the workbook code is: Private Sub Workbook_NewSheet(ByVal Sh As Object) MsgBox ("sheet added") End Sub and we want this executed by another macro. Just make the macro add a sheet: Sub newsheet() Sheets.Add End Sub and the Event gets triggered. 2. Without Context Here we want the code executed, but without actually adding a sheet. Here make the workbook code: Private Sub Workbook_NewSheet(ByVal Sh As Object) Call sheetsettup End Sub where sheetsettup is a macro in a standard module. Now any other macro can also call sheetsettup. -- Gary''s Student - gsnu200784 "Matt" wrote: Hi, I would like to know how to initiate a workbook event from a subroutine. It seems like it should be something like Call Workbook_Open Thanks, Matt |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Almost. It would be
Call ThisWorkbook.Workbook_Open but you must make Workbook_Open a Public procedure, the default signature is private. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Matt" wrote in message ... Hi, I would like to know how to initiate a workbook event from a subroutine. It seems like it should be something like Call Workbook_Open Thanks, Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call Event as Sub | Excel Programming | |||
how to call the event of other worksheet | Excel Worksheet Functions | |||
How to call an event procedure | Excel Programming | |||
Event to call before a opened workbook is recalculated | Excel Programming | |||
how to call a macro from a worksheet event? | Excel Programming |