Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Running macros and users (2002 SP-1)

    Does anyone know if, while a lengthy macro is running, the user still has input access via the keyboard?

    While the macro is busily selecting various parts of the document, can the user press a key and cause unintended consequences?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Running macros and users (2002 SP-1)

    While a macro is running, keystrokes are still being added to the keyboard buffer.

    But unless the macro invokes DoEvents from time to time, they will appear only when the macro has finished. On the other hand, if the macro displays a dialog or message box, the keystokes will go to the dialog or message box. So if you ask the user for a Yes or No somewhere in the macro, and the user has been pressing Y or N idly, the message box will be dismissed immediately...

    The user can press Ctrl+Break to pause the macro.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Re: Running macros and users (2002 SP-1)

    Thanks, Hans. That's what I thought. A fellow programmer here thought the a user could press a key and wipe out text selected by a macro while it was running.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Running macros and users (2002 SP-1)

    In general, it is wise not to touch the keyboard while a macro is running. What your colleague mentioned might happen.

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running macros and users (2002 SP-1)

    If the Userform is modelss, one must take care.

Posting Permissions

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