Code in modules of template

M

Marie

Using Word 2000. I created a template with lots of macros.
The macros were in two different modules (don't know how
that happened). I cut and pasted all of the macro code
from the smaller module to the NewMacros module. Now when
I try to run the macros with the moved code, I get this
message, "The requested member of the collection does not
exist." Some of the macros give the message and then
successfully execute, but others give the message and
don't execute. I can't remember the name of the module I
deleted. Is there any way I can salvage this template?

I really appreciate your help. Already tried help,
knowledge base, and the web.

Marie
 
J

Jezebel

If you removed the module without saving it, then no you can't salvage it
unless you have a backup of them template from before you made the change.

Post the code of one of the macros that fails. 'Requested member of the
collection' is not in itself related to the module that the code is in.
 
M

Marie

Here's code that doesn't work.

Sub EnvBusinessStLouis()
'
' EnvBusinessStLouis Macro
' Macro recorded 4/10/2003 by STC
'
Documents.Add Template:= _
"C:\Windows\Application
Data\Microsoft\Templates\Sensient\EnvBusinessStLouis.dot" _
, NewTemplate:=False, DocumentType:=0
End Sub

Marie
 
M

Marie

Just figured out that when I click on File, New to use the
template, I get the message, so must not have anything to
do with the macro. How did moving the macro code to a
difference module mess up other templates?

Marie
 
J

Jezebel

It didn't. The message must be coming from macro code in
EnvBusinessStLouis.dot. Open the template itself and look for a macro called
AutoNew. Either post that code, or if you know enough VBA, step through it
until you get the error.
 

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