Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Lamberta Schmidt   on Nov 02 In MS Office Category.

  
Question Answered By: Ibadah Younis   on Nov 02

> You may be misinterpretting what DoEvents is supposed to do.
DoEvents is a
> release from the application to the operating system.

This is in line  with my understanding. I'll read and digest, but
a quick scan of your explanation suggests that perhaps closing the
port within the polling loop will free up the OS to catch the mouse
event. I don't remember if I do this or not....stay tuned.

> The behavior you note
> is characteristic of a pre-emptively multitasking operating system.

Whatever...


> ...telling the operating system, "I'll hold what I'm doing so
> you can catch up with whatever else is going on."

This alligns with my understanding.



> There's an explanation ...support.microsoft...118468

Copied and will read.


> ...In the end, they used an approach similar to your
> solutions to cleanly handle events.

Ready and waiting to see that...


> experienced some of the following:
> "• Using too many nested DoEvents ...

No errors, just behavior as described.


> • Make sure the procedure that has given up control with
DoEvents is not executed again from a different part of your code
before the first DoEvents call returns; this can cause unpredictable
results.

Will examine, but don't think this is possible w/my code. THe port
open/close sounds like a good clue.


> • Once DoEvents relinquishes control to the operating system,
it is not possible to determine when Microsoft Excel will resume the
control. After the operating system obtains control of the processor,
it will process  all pending events

AS far as I know there should be only the mouse event (from my
code) , but if the system has other stuff running, that could mess
thins up.


> In the orginal problem, I was curious as to whether the
> Application.ScreenUpdating toggle has been used. With this, you can
greatly improve performance of the VBA app and only update the screen
when you're ready.

I am aware of the ScreenUpdating switch, however, the purpose of
this sub is specifically to place this data on the screen for the
user to see. It is data from a short wave (Ham) transceiver. As the
radio is tuned, it outputs the operating frequency and I catch it to
display on the sheet.

I'll digest the usoft support page. I frequent both this and the
MSDN.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Interesting problem when I run a vba process Or get search suggestion and latest updates.


Tagged: