Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What is the order of event handling (2000)

    We have Exceltemplates that contain VBA code events such as "Open" and also COM addins with the same event and we are wondering in what order these events are handled. It seems the events defined in the template are handled first and then any events in regular addins and COM addins are handled in different orders. One problem we are encountering is that the way an event is handled in a COM addin needs to take place before the event in a particular template event handler takes place and we are wondering if there is a way to control or majke the event in the template wait until the COM handler finishes?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: What is the order of event handling (2000)

    Does this list from Chip Pearson help?

    I know of no way to change the event order.

    Steve

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What is the order of event handling (2000)

    ONe way to make sure some code is run last is to use the ontime method inside the event.

    Private Sub Workbook_Open()
    Application.Ontime Now, "ContinueOpen"
    End Sub

    Then in a normal module you place a sub caled ContinueOpen that contains the code that needs to be run after all other event code is finished with its business.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •