Microsoft KB Archive/178167

= FIX: GeoFacts Sample Causes Automation Error on NT =

Article ID: 178167

Article Last Modified on 7/13/2004

-

APPLIES TO

 Microsoft Visual Basic 5.0 Professional Edition, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 2000 Standard Edition  Microsoft Visual Basic 5.0 Enterprise Edition, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 2000 Standard Edition</li></ul> </li> Microsoft Visual Basic 4.0 Professional Edition, when used with:  Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 2000 Standard Edition</li></ul>

 Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 2000 Standard Edition</li></ul> </li> Microsoft Visual Basic 4.0 16-bit Enterprise Edition, when used with:  Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 2000 Standard Edition</li></ul> </li> <li>Microsoft Visual Basic 4.0 32-Bit Enterprise Edition, when used with: <ul> <li>Microsoft Windows NT 4.0</li></ul>

<ul> <li>Microsoft Windows 2000 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q178167

<div class="symptoms_section">

SYMPTOMS
The GeoFacts.vbp sample project fails with the following run-time error when run on a Windows NT or Windows 2000 machine:

Run-time error '-2147467259 (80004005)':

Automation error

This error does not occur on a Windows 95, Windows 98, or Windows Me machine.

<div class="cause_section">

CAUSE
The run-time error occurs on the following line of code: Set shtWorld = GetObject("world.xls") The GetObject function fails because the full path to world.xls is not specified in the argument.

<div class="resolution_section">

RESOLUTION
When using the GetObject function, make sure that the full path to the file name is specified. To correct the code in the GeoFacts.vbp sample, change the following line of code (located in the Setup procedure in Module1): Set shtWorld = GetObject("world.xls") to: Set shtWorld = GetObject(app.path & "\world.xls")

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0.

<div class="references_section">