ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run-time error 429 (https://www.excelbanter.com/excel-programming/273042-run-time-error-429-a.html)

DM

Run-time error 429
 
I have written a macro that makes use of internet
explorer. The following code works properly on my
system. However, when I attempt to run the exact same
code on a different computer, perhaps with a slightly
different version of office (though they are both office
2000) it fails. The error message is: "Run-time Error
429: ActiveX Component Can't Create Object."

The code is:

Sub import()

' import Macro

Dim mybrowser As SHDocVw.InternetExplorer
Set mybrowser = GetObject(, "InternetExplorer.Application")
.....

The failure occurs when the 'Set mybrowser...' line is
executed.

Any suggestions would be helpful.


Keith Willshaw

Run-time error 429
 

"DM" wrote in message
...
I have written a macro that makes use of internet
explorer. The following code works properly on my
system. However, when I attempt to run the exact same
code on a different computer, perhaps with a slightly
different version of office (though they are both office
2000) it fails. The error message is: "Run-time Error
429: ActiveX Component Can't Create Object."

The code is:

Sub import()

' import Macro

Dim mybrowser As SHDocVw.InternetExplorer
Set mybrowser = GetObject(, "InternetExplorer.Application")
....


Check the references on the target machine, either one is
missing , set wrongly or its a different browser version.

Keith



Dave Peterson[_3_]

Run-time error 429
 
I think that 429 means that the the GetObject couldn't find a running instance
of MSIE.

So you check to see if it finds one. If it does, use it. If not, create a new
one.

Dim mybrowser As Object
On Error Resume Next
Set mybrowser = GetObject(, "InternetExplorer.Application")
If Err.Number = 429 Then
Set mybrowser = CreateObject("Internetexplorer.application")
mybrowser.Visible = True
Err.Clear
End If
On Error GoTo 0




DM wrote:

I have written a macro that makes use of internet
explorer. The following code works properly on my
system. However, when I attempt to run the exact same
code on a different computer, perhaps with a slightly
different version of office (though they are both office
2000) it fails. The error message is: "Run-time Error
429: ActiveX Component Can't Create Object."

The code is:

Sub import()

' import Macro

Dim mybrowser As SHDocVw.InternetExplorer
Set mybrowser = GetObject(, "InternetExplorer.Application")
....

The failure occurs when the 'Set mybrowser...' line is
executed.

Any suggestions would be helpful.


--

Dave Peterson



All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com