Microsoft KB Archive/113987

= Error Referencing Foreign Language Object Library =

Article ID: 113987

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Project 4.0 Standard Edition

-



This article was previously published under Q113987



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.

