Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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
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
priority setting Formatting Excel Discussion (Misc queries) 0 April 1st 09 06:50 PM
Priority (with macro??) Alonso[_2_] Excel Worksheet Functions 4 October 25th 08 01:02 PM
Priority Charge Michell Major Excel Discussion (Misc queries) 3 October 18th 06 12:13 PM
Process Priority nastech Excel Discussion (Misc queries) 0 April 25th 06 08:29 PM
priority naming ceemo Excel Worksheet Functions 3 April 6th 06 06:55 AM


All times are GMT +1. The time now is 07:20 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"