Error Referencing Foreign Language Object Library

Last reviewed: July 29, 1997
Article ID: Q113987
The information in this article applies to:
  • Microsoft Visual Basic Programming System, Applications Edition, version 1.0
  • Microsoft Project for Windows, version 4.0
  • Microsoft Excel for Windows, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

If you use the References dialog box to add a reference to an object library (.OLB) file, such as VBAFR.OLB, in a Visual Basic module that is written in a different language, you receive the following error message:

   Object library's language setting incompatible with current project

CAUSE

This is by design in Microsoft Visual Basic Programming System, Applications Edition. You cannot reference a object library file in a project that is using a different language. However, when you use the References dialog box to reference an object library file for a different language than the language your project is using, you "register" this object library, even though you receive the error message listed above.

Once the different language version of the object library file is registered, you can choose this Language setting from the Module General tab in the Options dialog box and use this language version in any new project. This setting determines the language that is used when you create a new project.

WORKAROUND

To register a different language version of an object library file and reference this language version in a new Visual Basic project, do the following:

  1. Copy the object library files (VBA*.OLB) to the SYSTEM subdirectory of your Windows directory (for example, C:\WINDOWS\SYSTEM). Copy the Microsoft Excel 5.0 object library files (XL*.OLB) to the directory in which you installed Microsoft Excel (wherever EXCEL.EXE is located).

  2. Start the application that you are using to create the Visual Basic module, for example, Microsoft Excel version 5.0.

  3. Create a new module. In the module, choose References from the Tools menu. Choose the Browse button. From the Directories list, select the Windows SYSTEM subdirectory.

  4. From the File Name list, select the object library file (for example, XLFR50.OLB) and choose OK. Choose OK in the dialog box that appears with the error message above.

  5. Repeat step 4 with the Visual Basic for Applications object library file (for example, VBAFR.OLB). In the References dialog box, choose OK.

  6. From the Tools menu, choose Options. Select the Module General tab, and under International, select Default Settings. From the Language/Country list, select the language and country of the object library file you want to use. Choose OK.

  7. Create a Visual Basic module in a new project.

Note that in Microsoft Excel, you must create a new workbook and then create the new module to use the new default Language/Country option. In Microsoft Project, you must create a new project and then create the new macro, and the macro must be stored in the project file.

MORE INFORMATION

The English object library file, VBAEN.OLB, is located in the SYSTEM subdirectory of your Windows directory. The Microsoft Project 4.0 object library file, PROJEN40.OLB, and the Microsoft Excel 5.0 object library file, XLEN50.OLB, are located in the directories in which you installed the respective applications.

These object libraries are automatically listed in the References dialog box in Microsoft Project, and in Microsoft Excel, and provide access to the methods and properties in the Microsoft Visual Basic Programming System, Applications Edition and in the individual applications.

Note that a Visual Basic module cannot have references to two different language versions of the Visual Basic object library or the application object library. The referenced languages must correspond to the Language/Country setting for the module. You can, however, reference a project using one language from a project written in another language.

REFERENCES

"Visual Basic User's Guide, Microsoft Excel," version 5.0, pages 281-286

Keywords          : kberrmsg kbprg
Version           : 1.00
Platform          : WINDOWS


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.