Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Cannot Import/Export UserForms Between VBA and Visual Basic


View products that this article applies to.

This article was previously published under Q213551

↑ Back to the top


Symptoms

In Microsoft Excel, if you try to import a Form that was created in Microsoft Visual Basic, the following error message appears:
The form class contained in <path to the form> is not supported in VBE. The file can't be loaded.
and you are unable to import the Form.

In Microsoft Visual Basic, if you try to import a UserForm that was created in Microsoft Excel, an error message similar to the following appears:
Errors during load. Refer to '<path to the UserForm>\Myform.log' for details.

followed by the error message:
'<path to the UserForm>' could not be loaded.
and you are unable to import the UserForm.

↑ Back to the top


Cause

You cannot import or export UserForms or Forms between Microsoft Excel and Microsoft Visual Basic.

↑ Back to the top


More information

Even though you cannot import or export Excel UserForms with Microsoft Visual Basic, you can import or export UserForms between different Excel projects.

How to Export a UserForm from Your Project

  1. Activate the UserForm in your project.
  2. On the File menu, click Export File.
  3. In the Export File dialog box, select a destination folder for the .frm file, and type a name for your file in the File Name text box.
  4. Click Save.

How to Import a UserForm from Another Project

  1. In the Project Explorer window, select the project that will import the UserForm you previously saved.
  2. On the File menu, click Import File.
  3. Locate and select the .frm file you want to import.
  4. Click Open.

↑ Back to the top


References

For more information about importing and exporting file commands, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type importing exporting userforms in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB213551, kbprogramming, kbprb, kberrmsg, kbdtacode

↑ Back to the top

Article Info
Article ID : 213551
Revision : 5
Created on : 10/10/2006
Published on : 10/10/2006
Exists online : False
Views : 284