Results 1 to 3 of 3
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DoEvents (VBA/Word/2005 SP2)

    DoEvents has a relatively large overhead, but I don't think that matters in an AutoExit macro - the user will hardly notice if the application takes a few tenths of seconds longer to quit. It's different than calling it in a loop that is executed millions of times.

    I don't know if DoEvents will make the macro work correctly, but it's worth a try.

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    DoEvents (VBA/Word/2003 SP2)

    I have an AutoExit macro which does some file deletion and moving on a server. I find that it works on some machines and not on others. There is no error raised, it just doesn't complete the task. One thought I have is to introduce a "DoEvents" command everywhere there is a suspicion of delay possibility.

    Is there any drawback/downside to a large number of DoEvents commands?


    TIA

    In the meantime I have seen that each DoEvents command adds 2 microseconds to the process.
    Regards
    Don

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DoEvents (VBA/Word/2005 SP2)

    Hans

    Thanks for the speedy response and the insight.
    Regards
    Don

Posting Permissions

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