Error Referencing Foreign Language Object Library
ID: Q113987
|
The information in this article applies to:
-
Microsoft Visual Basic programming system, Applications Edition
-
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:
- 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).
- Start the application that you are using to create the Visual Basic
module, for example, Microsoft Excel version 5.0.
- 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.
- 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.
- Repeat step 4 with the Visual Basic for Applications object library
file (for example, VBAFR.OLB). In the References dialog box, choose OK.
- 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.
- 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
Additional query words:
Keywords :
Version : :; WINDOWS:4.0,5.0,7.0
Platform : WINDOWS
Issue type :
|