XL2000: VBA Error on Macro Startup if You Open Multiple Excel Instances with RefEdit Control (320262)



The information in this article applies to:

  • Microsoft Excel 2000

This article was previously published under Q320262

SYMPTOMS

When you open an Excel workbook (.xls file) or add-in (.xla file) that uses the RefEdit control, you may receive one of the following unhandled exception error messages in Microsoft Visual Basic for Applications (VBA) on the first line of code to run in the project.
Error -2147467259 (&H80004005) : "Unspecified error"
-or-

Automation Error: The process cannot access the file because it is being used by another process
The problem occurs if multiple instances (for example, four or five) of Excel are running. Each instance contains workbooks or add-ins that also use the RefEdit control, and all of the temporary locations that hold extenders already have open libraries by the same name (one for each instance of Excel that is using the RefEdit control).

CAUSE

When a VBA project that contains the RefEdit control is loaded, VBA creates a control extender for the RefEdit type library. The formation of the control extender is similar to any control that you add to a UserForm. If multiple instances of Excel are running, Fm20.dll may fail while it attempts to create this extender. This failure can result in a VBA runtime error when your code is eventually called.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Office 2000 public update that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:
   Date          Time     Size         File Name     
   ---------------------------------------------------
   05-Apr-2002   18:18    1,382,268    Fm20.msp 
   05-Apr-2002   22:25    1,625,944    Fm20_admin.msp
   06-Jul-2001   12:11        2,882    Readme.txt
				
After the hotfix is installed, the following files will have the listed attributes or later:
   Date         Time   Version     Size       File Name     
   -------------------------------------------------------
   22-Mar-2002  16:38  2.1.9922.1  1,129,232  Fm20.dll
				

STATUS

Microsoft has confirmed that this is a problem in Microsoft Excel 2000.

MORE INFORMATION

Because the error occurs before the macro code is run, Excel starts the VBA Integrated Development Environment (IDE) and stops at the function entry point. This is similar to the behavior that occurs if VBA detects a compile error.

Steps to Reproduce the Behavior

  1. Start Excel 2000, and then create a new workbook.
  2. Press ALT+F11 to start the VBA IDE.
  3. On the Insert menu, click UserForm to add a new UserForm to the workbook.
  4. Add a RefEdit control to the UserForm.
  5. In ThisWorkbook, paste the following code in the Open event:
    Private Sub Workbook_Open()
       Dim x as Object
    End Sub
    					
  6. Save the workbook to a local folder.
  7. Start another instance of Excel.
  8. On the File menu, click Open, and then open another copy of the workbook that you just saved.

    NOTE: You may receive a macro warning dialog box followed by a File in Use dialog box that asks you if you want to open the Excel workbook in read-only format. Click Enable Macros, and then click Read Only.
  9. Repeat steps 6 and 7 three or four more times, until instead of the dialog box, you receive one of the error messages that is described in the "Symptoms" section.


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

199830 OFF2000: EXD Files Are Created When You Insert Controls


Modification Type:MinorLast Reviewed:10/12/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix kbOfficeXPPreSP2fix kbQFE KB320262