macro security warning...

V

V-ger

When trying to create and copy macros for another office, I kept getting
macro security warning error messages on all computers when trying to run
macros I created. I turned the Tools | Macro | Security settings down to low
(temporarily) and I still couldn't run simple macros (I've created several
for testing) but keep getting this error message on each computer. They are
all XP machines with newly installed (not by me) Office 2003. ALSO, The
macros are also not listed in my organizer (all I get is "New Macros" in the
list). I created them on the Normal.dot because I want to create them once
for the whole office to share. Is there a setting in Word other than Tools |
Macros | Security? Maybe it's something server-side to stop malware? I'm
completely stumped and really need some expert help. Thank you for any and
all suggestions! - V-ger
 
J

Jay Freedman

Hi V-ger,

First off, don't put those macros in Normal.dot. Put them in a
separate template and store that in Word's Startup folder. Set up a
mechanism to distribute the template to other users' Startup folders.
This is described in
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm.

Second, for the security stuff, make sure you go to the second tab of
the Security dialog and check the box for "Trust all installed add-ins
and templates". Then set the security level to Medium to get at least
a little protection against viruses.
 
V

V-ger

Thanks, Jay, but I have done all of those. The macro is actually on a
special company template that we set up to run a log-in script that loads it
when every user logs on. The tool/macro works on 65 of the 70 machines that
are networked, but why can't I get it to work on those few?

The error message I get consistently (there are others, but this one is on
ALL) is:
Runtime error '5941'. Requested member of the collection does not exist.
When it does offer me debug, and takes me to Visual Basic, it highlights:
End If: ActiveDocument.AttachedTemplate.AutoTextEntries ("filename adn
path")._Insert Where:=Selection,Range, RichText=True

I have been scratching my head over this for a couple of months now and have
read everything I can get my hands on. Please help. Thanks. (Also, it is
happening on various versions of Word: 2000, 2002, 2003 although all are
Windows XP)

Thank you, Thank you, Thank you.
 
J

Jay Freedman

Either the problem has changed or your original post was incorrect.
The 5941 error has nothing at all to do with macro security -- the
macro is in fact running, but something about the document or its
template isn't as expected.

The most likely cause is that the autotext entry named "Filename and
Path" (which is present in the default Normal.dot) has been deleted
from the Normal.dot templates on those few machines. The macro is
complaining that you're asking it to insert an autotext that doesn't
exist.

On those machines, you can recreate the missing autotext (it's just a
Filename field with the \p switch). But there's no way to tell what
else has been changed or deleted on any machine, that's just waiting
to bite you. It would be advisable to build error-handling into the
macro (and any other macros you distribute). Check out the On Error
statement in VBA help.
 
V

V-ger

Beautiful! I'll check it out this week when I return to that area. And
thanks for the additional reading...I ALWAYS need and learn from the tech
articles. I have been weeks trying to figure this one problem - so Thanks a
bundle, Jay. I'll let you know how it goes - please keep a weather eye out
for the reply. I really appreciate your help. - V-ger
 

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