Microsoft KB Archive/264743

= PRB: Error Messages When Editing, Running, or Recording VBA Macros in Office 97 Application on Windows 2000 =

Article ID: 264743

Article Last Modified on 1/27/2007

-

APPLIES TO


 * Microsoft Word 97 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft PowerPoint 97 Standard Edition

-



This article was previously published under Q264743



SYMPTOMS
When you log in as a default or restricted user on a Microsoft Windows 2000 computer and you try to run Microsoft Word 97, Microsoft Excel 97, or Microsoft PowerPoint 97 and then migrate to the Visual Basic for Applications Editor or record a macro from the application, you might receive an error message.

Microsoft Word:

When you start Microsoft Word, you receive the following error message:

The Windows registry has reported that one or more required files are damaged or missing. To correct this problem, run the Word Setup program.

After you click OK to dismiss the dialog box and launch Word, if you then attempt to use the VBA Editor or record a new macro, you receive the following error message:

Could not open macro storage.

Microsoft Excel:

When you start Microsoft Excel, you receive the following error message:

Cannot use object linking and embedding.

If you ignore the preceding error message, and then attempt to use the VBA Editor, the VBA Editor may appear momentarily and then shut down, or you may receive the following error message:

The instruction at &quot;0x3044f435&quot; referenced memory at &quot;0x00000018&quot;. The memory could not be &quot;read&quot;.

Microsoft PowerPoint:

When you try to start Microsoft PowerPoint, you may receive the following error message and PowerPoint may shut down:

PowerPoint found an error that it can't correct. You should save presentations, exit, and then restart PowerPoint.

In some cases, PowerPoint starts up and displays the preceding error message when you try to move to the VBA Editor or record a macro.



CAUSE
When a user accesses VBA for the first time, VBA creates a file named MSForms.exd in the user's temporary folder. This file is a type library that VBA caches for a COM object and is required for FM20/MSForms to function correctly. Once VBA creates the type library file, it then attempts to register it; if the user does not have write access to required registry keys, the registration fails. Consequently, VBA fails to initialize properly and various errors might occur on attempts to use VBA in Office 97 applications.

Users running Windows 2000 who are members of the Users group only and who do not have Administrator or Power User privileges might encounter this problem due to restraints for write access to required registry keys.



STATUS
This behavior is by design.



Workaround #1
Search the user's temporary folder for MSForms.exd and delete the file. With Windows 2000, each user has his or her own temporary folder. For example:

C:\Documents and Settings\[UserName]\Local Settings\Temp\VBE\MSForms.exd

Once you have deleted MSForms.exd, you should then grant write access to the following keys for the users who need to use VBA from Office 97 applications:

HKEY_CLASSES_ROOT\Clsid

HKEY_CLASSES_ROOT\Typelib

HKEY_CLASSES_ROOT\Interface

Steps to Grant Permissions to Registry Keys
 * 1) Log in as Administrator.
 * 2) On the Windows Start menu, click Run. Type regedt32.exe, and then click OK to start the Registry Editor.
 * 3) Locate the key HKEY_CLASSES_ROOT\Clsid.
 * 4) On the Security menu, click Permissions. The Registry Key Permissions dialog box appears.
 * 5) Click on Add, add the users or groups, and then select Full Control for the type of access.
 * 6) Click OK to close the dialog box.
 * 7) Repeat steps 3 through 6 for the remaining registry keys.
 * 8) Quit the registry editor. This allows users to register type-libraries, COM objects, and so forth.

Workaround #2
If a user with Power User or Administrator privileges has already used VBA on the system, an MSForms.exd file has been created for that user. Copy this MSForms.exd to the restricted user's temporary folder. If you want new users to get the MSForms.exd automatically, you could put a copy in the temporary folder for the Default User. For example, in the directory:

C:\Document Settings\Default User\Local Settings\Temp\vbe\Msforms.exd

If no user has previously used VBA on the system and no MSForms.exd has been created, then you could copy this file from another system and register it as a user with write access to the registry keys mentioned in &quot;Workaround #1&quot;. To register the type library, on the Windows Start menu, choose the Run command, type the following, and then click OK:

regtlib.exe C:\Temp\VBE\msforms.exd

If users already have this file, replace it with the one from the Administrator or Power User's Temp\Vbe directory.

Steps to Reproduce the Error
The following steps describe how to reproduce this error from Word 97. Other Office applications have similar steps.  Log in to Windows 2000 as a user with default permissions. Start Microsoft Word 97. Press the ALT+F11 keys to start the VBA editor, and note that you receive the error message:

&quot;Could not Open macro storage&quot;.

Additionally, when you attempt to run or record a macro, you may receive one of the errors described in the &quot;Symptoms&quot; section.

