I have an ActiveX Control that performs actions based on user interaction with it. The control enters a start "mode" when a certain case is found in the main application. The problem is, I want execution to pause or wait, until the ActiveX control has finished its actions.

Currently the start mode call is in the middle of a HUGE code block with a lot of logic (in an Event). I am using the following to simulate what I want:

VB Code:
  1. MyControl.Start
  2. Do While MyControl.Running
  3.      DoEvents
  4. Loop

This works perfectly except that the processor is pegged due to the loop. I would like a way to simulate the following:

VB Code:
  1. MyControl.Start
  2. 'WAITING FOR RETURN FROM ACTIVEX ACTIONS
  3.  
  4. 'COMPLETE, GO ON

It is not an option to remove code following the call from the Event as it is part of the flow and has many variables set.

Any ideas?