5981 Error : Could not open Macro Storage 
Author Message
 5981 Error : Could not open Macro Storage

Firstly, sorry about the cross-post but this is urgent and needed for a
demonstration on Monday !!!!

I am using VB 5 Enterprise to automate MS Word 8 (Office 97).

I have written an ActiveX DLL which receives a record ID from an ODBC
Database and then composes a letter in Word.

The "pseudo-code" steps are :-

    Take the Record ID
    Create a word document called {ID}.DOC
    Compose the letter.
    Insert the content from the database
    Close the Document.

This all works fine in an executable, and, indeed from an executable calling
the DLL.

However, this is part of an intranet solution and needs to be called from
ASP (Active Server Page).

I've initialised the object and called the function in my DLL but it falls
over with :-

    "Error 5981 - could not open macro storage"

I have been through the newsgroups and the MS Knowledge Base and from what I
can find, the explanations are :-

Corrupt Template

Solution :- Rename normal.dot and try again.

Corrupt Document

Solution :- Export the VBA code from the document, create a new document and
re-import the code into it.

I have gone down the template route to no avail, but, since my application
creates the document from scratch rather than opening an existing one, I
don't see how it can be corrupt.

I have checked the VBE.DLL (Visual Basic Editor) and this all seems OK.

The code falls over on the DOCUMENTS.ADD line to an object that I have
created as "Word.Document"

I have included the reference to the MS Word 8.0 object library but I'm
stumped :- It works in an EXE and the DLL works when called from an EXE.

If anybody can shed ANY light on this, I would be EXTREMELY grateful.

Kind regards

--
Steve Butler
SBN Membership Level 2
http://www.*-*-*.com/ ~sbutler



Wed, 31 Jan 2001 03:00:00 GMT  
 5981 Error : Could not open Macro Storage
I have seen this occur when the word file somehow contains a refrence to an
old version of the DLL you are using ...  (What i mean ... you may have
recompiled a couple of time and broken the Dll ) ... I dont know if this
helps

Quote:

>Firstly, sorry about the cross-post but this is urgent and needed for a
>demonstration on Monday !!!!

>I am using VB 5 Enterprise to automate MS Word 8 (Office 97).

>I have written an ActiveX DLL which receives a record ID from an ODBC
>Database and then composes a letter in Word.

>The "pseudo-code" steps are :-

>    Take the Record ID
>    Create a word document called {ID}.DOC
>    Compose the letter.
>    Insert the content from the database
>    Close the Document.

>This all works fine in an executable, and, indeed from an executable
calling
>the DLL.

>However, this is part of an intranet solution and needs to be called from
>ASP (Active Server Page).

>I've initialised the object and called the function in my DLL but it falls
>over with :-

>    "Error 5981 - could not open macro storage"

>I have been through the newsgroups and the MS Knowledge Base and from what
I
>can find, the explanations are :-

>Corrupt Template

>Solution :- Rename normal.dot and try again.

>Corrupt Document

>Solution :- Export the VBA code from the document, create a new document
and
>re-import the code into it.

>I have gone down the template route to no avail, but, since my application
>creates the document from scratch rather than opening an existing one, I
>don't see how it can be corrupt.

>I have checked the VBE.DLL (Visual Basic Editor) and this all seems OK.

>The code falls over on the DOCUMENTS.ADD line to an object that I have
>created as "Word.Document"

>I have included the reference to the MS Word 8.0 object library but I'm
>stumped :- It works in an EXE and the DLL works when called from an EXE.

>If anybody can shed ANY light on this, I would be EXTREMELY grateful.

>Kind regards

>--
>Steve Butler
>SBN Membership Level 2
>http://www.pncl.co.uk/~sbutler




Thu, 01 Feb 2001 03:00:00 GMT  
 5981 Error : Could not open Macro Storage
the only time i've ever seen 'could not open macro storage space' was when
my copy of word was infected with the WMCAP virus.

i hope this is not the case with you.

(as a test, try to save a document as rtf and open it in notepad. if it
looks like rtf, you're clean, if it's still a binary, get a virus killer)



Fri, 02 Feb 2001 03:00:00 GMT  
 5981 Error : Could not open Macro Storage
Thanks Ben / Tarek,

We did have this virus a while ago but it's gone now.

As for my initial problem, this has now been fixed :) I had to re-install
IIS 4.0 and then everything ran fine.  Go figure ............

Steve

Quote:

>the only time i've ever seen 'could not open macro storage space' was when
>my copy of word was infected with the WMCAP virus.

>i hope this is not the case with you.

>(as a test, try to save a document as rtf and open it in notepad. if it
>looks like rtf, you're clean, if it's still a binary, get a virus killer)



Fri, 02 Feb 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error: 5981 Could not open macro storage

2. 5981 could not open macro storage error

3. error 5981 - could not open macro storage

4. 5981 error, "Cannot open macro storage"

5. Could not open macro storage error '5981' - one cure

6. Error 5981 'Could not open macro storage'

7. "Run-time error 5981, Could not open macro storage."

8. Could not open macro storage error: 5891

9. error - Could not open macro storage

10. Could not open macro storage error.

11. could not open macro storage

12. Could Not Open Macro Storage

 

 
Powered by phpBB® Forum Software