Running a VBA code window command from Word

L

Larry

Very often, when experimenting with a macro, I'm ready to run the macro
in Word, but the VBA code window needs to be reset, so I've got to open
the code window, do the Run, Reset command, then go back to Word.

Is there a way to run that command (or other commands relating to the
VBA code window environment) without opening the VBA window?

Larry
 
K

koolnuts

try:

VBE.CommandBars("Debug").Controls("Reset").Execute

If you get error 6068

Tools->Macros->Security and enable the checkbox to "Trust Access to VB
Project"
 
J

Jeff

Not as far as I'm aware but if the problem you are referring to is that a
macro us in the middle of debug-execution, the shortcut keyboard commands
would be

Alt-F11 Alt-F4 {Return}
 
L

Larry

Thanks, but I just realized the solution I want is impossible. I'm
trying to create a macro that I could run from Word that would reset
another macro that is in the middle of de-bugging. But of course, if a
macro is in the middle of breakmode, and you try to run another macro,
you get an error message: "Can't execute code in Break mode."

In fact, what I wanted was, when I got that "Can't execute code in Break
mode" message, to be able to end the Break mode from Word. In other
words, I'd be reducing a three-step process (Alt+11, Reset, Alt+11) to
one step. But I guess it ain't possible.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top