BUG: Cannot Reference Excel 8.0 Object Library from VB 4.0x (170356)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Professional Edition for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Enterprise Edition for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Excel for Windows 5.0
- Microsoft Excel for Windows 5.0a
- Microsoft Excel for Windows 5.0c
- Microsoft Excel for Windows NT 5.0
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 95 7.0a
- Microsoft Excel 97 for Windows
- Microsoft Office for Windows 4.2
- Microsoft Office for Windows 4.2b
- Microsoft Office for Windows 4.2c
- Microsoft Office for Windows 4.3
- Microsoft Office for Windows 4.3c
- Microsoft Office for Windows 95
- Microsoft Office for Windows 95 7.0a
- Microsoft Office for Windows 95 7.0b
- Microsoft Office 97 for Windows
- Microsoft Project 98 for Windows
- Microsoft Project for Windows 95 4.1
- Microsoft Project for Windows 95 4.1a
- Microsoft Project for Windows 4.0
This article was previously published under Q170356 SYMPTOMS
Microsoft Visual Basic 4.0x does not allow addition of the Microsoft Excel
8.0 Object Library via Tools/References when the Microsoft Excel 5.0 Object
Library is listed there.
CAUSE
When adding a new version of an object (or type) library to its
Tools/Reference list, Microsoft Visual Basic 4.0x, in spite of the
distinctly different version numbers of the old and new object libraries,
insists, via an internal string-comparison routine, that the new library's
Locale/Country ID (LCID) be identical to the old library's LCID. Because
the Microsoft Excel 5.0 Object Library has an LCID of 9 (English) and the
Microsoft Excel 8.0 Object Library has an LCID of 0 (Default Language),
this test fails; Microsoft Visual Basic 4.0x then displays the error:
"Object library's language setting incompatible with current project"
and does not add the new library to the Tools/Reference list.
RESOLUTION
There are two workarounds: one affects all newly created projects; the
other, the current project only.
NOTE 1: The underscore character (_) below is used as a line-continuation
character and should not be typed. There should be no spaces between the
character preceding the underscore and the letter on the next line.
NOTE 2: The references below presume that the directory containing
Microsoft Office 97 for Windows is C:\OFFICE97 and that the pertinent
Microsoft Excel 8.0 Object Library file, EXCEL8.OLB, is located in the
directory C:\OFFICE97\OFFICE.
Method 1
This approach modifies Microsoft Visual Basic 4.0x's default project file
so that the Microsoft Excel 8.0 Object Library will be available to all
newly-created projects.
- In a text editor such as NOTEPAD.EXE, open the AUTO32LD.VBP project
file, located in the Microsoft Visual Basic 4.0x directory. The file's
contents will resemble the following:
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0; comdlg32.ocx
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.0#0; tabctl32.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.0#0; richtx32.ocx
Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.0#0; comctl32.ocx
Object={FAEEE763-117E-101B-8933-08002B2F4F5A}#1.0#0; dblist32.ocx
Object={00028C01-0000-0000-0000-000000000046}#1.0#0; DBGRID32.OCX
Object={F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#1.0#0; msrdc32.ocx
Reference=*\G{BEF6E001-A874-101A-8BBA-00AA00300CAB}#2.0#0#C:\WINDOWS\_
SYSTEM32\OLEPRO32.DLL#Standard OLE Types
Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#1.0#0#C:\WINDOWS\_
SYSTEM32\MSRDO32.dll#Microsoft Remote Data Object 1.0
Name="Project1"
- Add the line below:
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.2#0#C:\OFFICE97\_
OFFICE\EXCEL8.OLB#Microsoft Excel 8.0 Object Library
so that the file appears as follows:
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0; comdlg32.ocx
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.0#0; tabctl32.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.0#0; richtx32.ocx
Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.0#0; comctl32.ocx
Object={FAEEE763-117E-101B-8933-08002B2F4F5A}#1.0#0; dblist32.ocx
Object={00028C01-0000-0000-0000-000000000046}#1.0#0; DBGRID32.OCX
Object={F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#1.0#0; msrdc32.ocx
Reference=*\G{BEF6E001-A874-101A-8BBA-00AA00300CAB}#2.0#0#C:\WINDOWS\_
SYSTEM32\OLEPRO32.DLL#Standard OLE Types
Reference=*\G{EE008642-64A8-11CE-920F-08002B369A33}#1.0#0#C:\WINDOWS\_
SYSTEM32\MSRDO32.dll#Microsoft Remote Data Object 1.0
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.2#0#C:\OFFICE97\_
OFFICE\EXCEL8.OLB#Microsoft Excel 8.0 Object Library
Name="Project1"
- Save the AUTO32LD.VBP file and close the text editor.
- Start Microsoft Visual Basic 4.0x and select Tools, then References.
- The Microsoft Excel 5.0 Object Library no longer appears in the list.
Instead, the Microsoft Excel 8.0 Object Library is available and checked
for use.
Method 2
This technique modifies a given project's VBP file to include the Microsoft
Excel 8.0 Object Library just for that project.
- Save and close the project with the Microsoft Excel 5.0 Object Library
reference.
- In a text editor such as NOTEPAD.EXE, open the project's VBP file and
change the reference to Microsoft Excel from:
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.0#9#C:\OFFICE97\_
OFFICE\XL5EN32.OLB#Microsoft Excel 5.0 Object Library
to:
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.2#0#C:\OFFICE97\_
OFFICE\EXCEL8.OLB#Microsoft Excel 8.0 Object Library
- Save the project's VBP file and close the text editor.
- Start Microsoft Visual Basic 4.0x, and then load and save the project.
- Select Tools, then References. The Microsoft Excel 5.0 Object Library no
longer appears in the list. Instead, the Microsoft Excel 8.0 Object
Library is available and checked for use with this project. Newly-
created projects will revert to the Microsoft Excel 5.0 Object Library.
STATUS
Microsoft has confirmed this to be a bug in the versions of Microsoft
Visual Basic listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 8/18/2005 |
---|
Keywords: | kbAutomation kbBug kberrmsg kbinterop kbpending KB170356 |
---|
|