Run-time Error 5891 on ActiveDocument

D

dubbglubb

I have a separate issue with my Word VBA form that I can't work out.

While testing my template on other machines I get the Run-time Erro
5891
"Could not open macro storage"

This occurs as the user initiates the DOCVARIABLE field update events
a procedure that works perfectly on my terminal.

Debugging shows error occurs at the with ActiveDocument line


Code
-------------------

With ActiveDocument

.Variables("OurRef").Value = varOurRef & lblAmend.Caption
.Variables("LetterRef").Value = txtDescription.Text

-------------------


In fact it appears that any *ActiveDocument* code will bring up thi
error.

ActiveDocument doesn't work in the immediate window when attempte
within this template, but works if used within Normal.dot.

I've checked that all references are the same on both machines.

Any ideas?

Cheer
 
C

Cindy M.

Hi Dubbglubb,

I had something like this happen to me the other day and it turned out to
be a corrupted template. Not the one the code was in, but another one
loaded as a global template that my template was referencing. Since that
template was damaged, it caused references (as in Tools/References) to
break in my template.

Not knowing how your entire VBA project is built, it's hard to say where
the problem could be, but...

Since the template works on your machine, my guess would be there's
something wrong on the user's machine. First thing I'd try would be to
start Word in Safe Mode and see if the template works then.
I have a separate issue with my Word VBA form that I can't work out.

While testing my template on other machines I get the Run-time Error
5891
"Could not open macro storage"

This occurs as the user initiates the DOCVARIABLE field update events -
a procedure that works perfectly on my terminal.

Debugging shows error occurs at the with ActiveDocument line


Code:
--------------------

With ActiveDocument

.Variables("OurRef").Value = varOurRef & lblAmend.Caption
.Variables("LetterRef").Value = txtDescription.Text

--------------------


In fact it appears that any *ActiveDocument* code will bring up this
error.

ActiveDocument doesn't work in the immediate window when attempted
within this template, but works if used within Normal.dot.

I've checked that all references are the same on both machines.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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