Excel automation: are there some timing constraints?

J

Jack

<I had posted that in vbasic newsgroup 3 days ago but I had no response>

==========
Talking about:

Private Sub moExcelApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)
<my code>
End Sub

Can I place my code safely inside that subroutine or are there some timing
restrictions?

There must be some timing limitations, because when I step through the code
in that routine (place a breakpoint), MsExcel starts flashing and displays
message that it waits for OLE operation to be completed or something like
that.
Where I can read about it more?
Jack


Your comments appreciated,
Jack
 
G

Gary Brown

Could the code simply be waiting for the worksheet selection to change?
If you don't go to another worksheet, the code doesn't fire.

--
HTH,
Gary Brown
[email protected]
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
 
J

Jack

Which code?
I think you do not understand my post.
That routine is fired EACH time you click on the sheet!!!!
Jack
 
G

Gary Brown

You're right. I misread the question.

Could the code simply be waiting for the worksheet cell selection to change?
If you don't go to another cell, the code doesn't fire.

--
HTH,
Gary Brown
[email protected]
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
 
P

Peter T

Hi Jack,

The VB experts tend to be less responsive to questions as vague as yours
which may be the reason you didn't get a response. Following based on a
guess as to what you are doing.

VB/A and Excel's calculation routines do not run asynchronously (unless
doing something like Shell).

If (?) you are doing something like VB > VBA (> XL-cells-calc > VBA) > VB,
this will typically run consecutively (although DoEvents may be required for
just a few things).

If (?) you are stepping between VB/VBA the message you get is normal
although annoying. Dismiss it whenever you see it (might be hidden under a
window), particularly if you go on to press F5 or things may slow
considerably or give problems switching between windows.

When code is run normally the little you have described does not of its own
indicate a problem.

Regards,
Peter T
 
Top