Debugging Problem In VBE

H

Harry-Wishes

Hello,

I have come across a strange phenomena as I'm stepping through my code with
the F8 key in the VBA editor. There is a certain point in my subroutine
where the rest of the code self-executes to completion. I'll explain more.

When I reach the command (shown below) which happens to create a new
document from a template, it executes fine. However, after this command
executes, the VBA editor takes control of my debugging and executes the rest
of my subroutine as though the entire macro had been executed at runtime.
Obviously, this prevents me from stepping through my code after this point in
the program. Can someone offer me a suggestion or explain what could be the
trouble? Again my script is below.

Thanks

Harry Wishes

Documents.Add Template:= _
"C:\Documents and Settings\" & UserName & "\Application
Data\Microsoft\Templates\Word_HTML.dot" _
, NewTemplate:=True, DocumentType:=0
 
D

Doug Robbins - Word MVP

I am not saying that it will help sort out the problem, but if you showed
all of the code it might.

Is there any code in the template Word_HTML.dot?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
H

Harry-Wishes

Ah Ha!

You just clued me in on something. Indeed there is code in the
Word_HTML.dot. I commented out the code inside the template and lo and
behold, that solved the issue. I'll can now test to see which subroutine is
causing the self-execution.

Thanks for you help.

Harry-Wishes
 

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