Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event priority
Hi,
Does anybody know about events's priority ?. For instance, in the same workbook, three events procedures triggered by the same event: a sheet activation. in the sheet module of Sheet1 Private Sub Worksheet_Activate() MsgBox "triggered by sheet module" End Sub in the Thisworkbook module Private Sub Workbook_SheetActivate(ByVal Sh As Object) MsgBox "triggered by Thisworkbook module" End Sub in a class module named Class1 with the variable Appl declared in the class module as Public WithEvents Appl As Application and an instance of the class module that has been previously created in a standard module Private Sub Appl_WorkbookActivate(ByVal Wb As Workbook) MsgBox "triggered by Class module" End Sub Doing so, when Sheet1 is activated, the 1st message is the one of the sheet module, the 2nd the Thisworkbook module one, the 3rd the class module one, which means that there's some kind of priority in the cascade of the events procedures . Is it possible to break this priority and make one of my choice , and if so , how to do it ? I don't want to use the instruction Application.ontime in order to slow down the procedures triggered by the events. I know I could fix it this way, but I 'd like to know if there's an other way that is not a workaround. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event priority
I think you are stuck with the priority as Excel sees it. OnTime is a
standard way of getting control of the order, or to provide 'After' events. So, as far as I am aware, Ontime is the way. -- HTH RP (remove nothere from the email address if mailing direct) "anonymousA" wrote in message ... Hi, Does anybody know about events's priority ?. For instance, in the same workbook, three events procedures triggered by the same event: a sheet activation. in the sheet module of Sheet1 Private Sub Worksheet_Activate() MsgBox "triggered by sheet module" End Sub in the Thisworkbook module Private Sub Workbook_SheetActivate(ByVal Sh As Object) MsgBox "triggered by Thisworkbook module" End Sub in a class module named Class1 with the variable Appl declared in the class module as Public WithEvents Appl As Application and an instance of the class module that has been previously created in a standard module Private Sub Appl_WorkbookActivate(ByVal Wb As Workbook) MsgBox "triggered by Class module" End Sub Doing so, when Sheet1 is activated, the 1st message is the one of the sheet module, the 2nd the Thisworkbook module one, the 3rd the class module one, which means that there's some kind of priority in the cascade of the events procedures . Is it possible to break this priority and make one of my choice , and if so , how to do it ? I don't want to use the instruction Application.ontime in order to slow down the procedures triggered by the events. I know I could fix it this way, but I 'd like to know if there's an other way that is not a workaround. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Event priority
Thanks for your answer and too bad there's no solution.
Regards Bob Phillips a écrit : I think you are stuck with the priority as Excel sees it. OnTime is a standard way of getting control of the order, or to provide 'After' events. So, as far as I am aware, Ontime is the way. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
priority setting | Excel Discussion (Misc queries) | |||
Priority (with macro??) | Excel Worksheet Functions | |||
Priority Charge | Excel Discussion (Misc queries) | |||
Process Priority | Excel Discussion (Misc queries) | |||
priority naming | Excel Worksheet Functions |