Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Running a VBA code window command from Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry - 03 Feb 2005 04:37 GMT
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
koolnuts - 03 Feb 2005 08:31 GMT
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"

> 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
[quoted text clipped - 4 lines]
>
> Larry
Larry - 03 Feb 2005 21:26 GMT
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

> try:
>
[quoted text clipped - 14 lines]
> >
> > Larry
Jeff - 03 Feb 2005 10:43 GMT
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}

> 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
[quoted text clipped - 4 lines]
>
> Larry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.