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



The information in this article applies to:

  • Microsoft Word 97 for Windows
  • Microsoft Excel 97 for Windows
  • Microsoft PowerPoint 97 for Windows

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 "0x3044f435" referenced memory at "0x00000018". The memory could not be "read".
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.

MORE INFORMATION

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 "Workaround #1". 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.
  1. Log in to Windows 2000 as a user with default permissions.
  2. Start Microsoft Word 97.
  3. Press the ALT+F11 keys to start the VBA editor, and note that you receive the error message:
    "Could not Open macro storage".
    Additionally, when you attempt to run or record a macro, you may receive one of the errors described in the "Symptoms" section.

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

244064 INFO: Upgrade Techniques for Controls and Extenders w/VBASDK

For more information, please see the following Microsoft Web page:

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbprb kbProgramming KB264743