PDA

View Full Version : Solved: Application.Interactive property



Adamski
06-10-2009, 06:30 AM
In excel the code:
Application.Interactive = False
prevents the user from interfering with Excel until it is set back to true. It can be used to prevent the user doing anything while a macro runs.

Is there an equivalent for word?

Cheers

fumei
06-10-2009, 09:48 AM
Well I do not know how that works in Excel, as I most certainly am not an Excel person.

But as for Word, it is a moot point. If a procedure ( a macro) is executing, unless the procedure makes a call for user input, there can not BE user input (doing anything) as the procedure has focus.

In other words, "while a macro runs" a user can NOT do anything. Are you implying that they can?

OK, OK, yes it is possible to break execution of a procedure. Is that what you are taking about?

In any case, no, there is no equivalent in Word to the .Interactive property in Excel. From looking at the Help for it, it would possibly be a good idea though. I never knew Excel had such a thing. Block all keyboard and mouse input? Wow.

Adamski
06-11-2009, 05:23 AM
Fair enough. Being automatically blocked is fine for me.

carrrnuttt
06-15-2009, 05:05 PM
I just thought I'd add that although a running macro doesn't allow a user to interact with Word directly, using CTRL+Pause/Break can stop a macro dead in its tracks even in Word.

To prevent this, you have to run this code:

At the start of the macro:

Application.EnableCancelKey = wdCancelDisabled

At the end of the macro:

Application.EnableCancelKey = wdCancelInterrupt

fumei
06-16-2009, 09:03 AM
"OK, OK, yes it is possible to break execution of a procedure. "

Thank you for posting the actual specifics, as the OP may not have been aware of it.

carrrnuttt
06-16-2009, 01:11 PM
"OK, OK, yes it is possible to break execution of a procedure. "

Thank you for posting the actual specifics, as the OP may not have been aware of it.

No problem. I didn't even see that you already mentioned the break execution. I just figured if the OP is really worried about people stopping his code execution, this might be something he'd be interested in (in case he didn't know already).

fumei
06-17-2009, 09:02 AM
Which is why I thanked you for mentioning it...the OP just may.