Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Vista, IE7 and Excel 2000

The following code used to work - a year or two ago.

Sub X()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set IE = Nothing
End Sub

Now I get the following error at the ReturnURLcontent$ line.
Run-time error '-2147467259 (80004005)':
Method 'Document' of object 'IWebBrowser2' failed

I've also tried the following.

Sub Y()
Const READYSTATE_COMPLETE& = 4&
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
While Not .ReadyState = READYSTATE_COMPLETE
DoEvents
Wend
.Quit
End With
Set IE = Nothing
End Sub

I get the following error after the While Not... line
Run-time error '-2147417848 (80010108)':
Automation Error
The object invoked has diconeccted from its clients.

Any help with be greatly appreciated.

Thanks much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Vista, IE7 and Excel 2000

I think I'd try this. I'm on XP, IE7 and Excel 2003.

Sub X()
'Need Microsoft Internet Controls reference selected
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Visible = True
With myIE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
Debug.Print .Busy
Debug.Print .ReadyState

DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set myIE = Nothing
End Sub

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Kevin" wrote:

The following code used to work - a year or two ago.

Sub X()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set IE = Nothing
End Sub

Now I get the following error at the ReturnURLcontent$ line.
Run-time error '-2147467259 (80004005)':
Method 'Document' of object 'IWebBrowser2' failed

I've also tried the following.

Sub Y()
Const READYSTATE_COMPLETE& = 4&
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
While Not .ReadyState = READYSTATE_COMPLETE
DoEvents
Wend
.Quit
End With
Set IE = Nothing
End Sub

I get the following error after the While Not... line
Run-time error '-2147417848 (80010108)':
Automation Error
The object invoked has diconeccted from its clients.

Any help with be greatly appreciated.

Thanks much.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Vista, IE7 and Excel 2000

Thanks Barb. Specifying the IE object type seemed to have an affect. I'm
still trouble shooting. I've tested the following six configurations. Only
Sub CC completes without error. Looks like [Do Until Not .Busy And
..ReadyState < 4] is working but only when there's no msgbox after navigate.
And it looks like I've isolated the problem to IE.Document.Body.InnerText. I
do have Microsoft Internet Controls reference selected.

Sub A()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
MsgBox "IE.Navigate ok"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '462'
'The remote server machine does not exist or is unavailable
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub B()
'same as A except delete [MsgBox "IE.Navigate ok"]
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Method 'Busy' of object 'IWebBrowser2' failed
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub CC()
'same as B except [Dim IE As SHDocVw.InternetExplorer]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub D()
'same as CC except add [MsgBox "IE.Navigate ok"]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
MsgBox "IE.Navigate ok"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '462'
'The remote server machine does not exist or is unavailable
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub E()
'same as CC except add [ReturnURLcontent$ = .Document.Body.InnerText]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.InnerText
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Automation error
'Unspecified error
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub F()
'same as E except [IE.ReadyState = READYSTATE_COMPLETE]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Automation error
'Unspecified error
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.InnerText
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

"Barb Reinhardt" wrote:

I think I'd try this. I'm on XP, IE7 and Excel 2003.

Sub X()
'Need Microsoft Internet Controls reference selected
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Visible = True
With myIE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
Debug.Print .Busy
Debug.Print .ReadyState

DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set myIE = Nothing
End Sub

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Kevin" wrote:

The following code used to work - a year or two ago.

Sub X()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set IE = Nothing
End Sub

Now I get the following error at the ReturnURLcontent$ line.
Run-time error '-2147467259 (80004005)':
Method 'Document' of object 'IWebBrowser2' failed

I've also tried the following.

Sub Y()
Const READYSTATE_COMPLETE& = 4&
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
While Not .ReadyState = READYSTATE_COMPLETE
DoEvents
Wend
.Quit
End With
Set IE = Nothing
End Sub

I get the following error after the While Not... line
Run-time error '-2147417848 (80010108)':
Automation Error
The object invoked has diconeccted from its clients.

Any help with be greatly appreciated.

Thanks much.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default Vista, IE7 and Excel 2000

I used XP, IE6 and Excel 2003 and got the following to work. So I'm
concluding that there is something about the combination of Vista, IE7 and
Excel 2000 that is giving me this problem. I'm guessing a Vista, IE7 and
Excel 2003 or Excel 2007 configuration will solve my problem. Any thoughts?
Thanks.

Sub G()
'same as [Sub F] except add [MsgBox ReturnURLcontent$]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.InnerText
MsgBox ReturnURLcontent$
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

"Kevin" wrote:

Thanks Barb. Specifying the IE object type seemed to have an affect. I'm
still trouble shooting. I've tested the following six configurations. Only
Sub CC completes without error. Looks like [Do Until Not .Busy And
.ReadyState < 4] is working but only when there's no msgbox after navigate.
And it looks like I've isolated the problem to IE.Document.Body.InnerText. I
do have Microsoft Internet Controls reference selected.

Sub A()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
MsgBox "IE.Navigate ok"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '462'
'The remote server machine does not exist or is unavailable
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub B()
'same as A except delete [MsgBox "IE.Navigate ok"]
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Method 'Busy' of object 'IWebBrowser2' failed
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub CC()
'same as B except [Dim IE As SHDocVw.InternetExplorer]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub D()
'same as CC except add [MsgBox "IE.Navigate ok"]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
MsgBox "IE.Navigate ok"
Do Until Not .Busy And .ReadyState < 4
'get the following error message at this point
'Run-time error '462'
'The remote server machine does not exist or is unavailable
DoEvents
Loop
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub E()
'same as CC except add [ReturnURLcontent$ = .Document.Body.InnerText]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.InnerText
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Automation error
'Unspecified error
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

Sub F()
'same as E except [IE.ReadyState = READYSTATE_COMPLETE]
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
MsgBox "Set IE ok"
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
'get the following error message at this point
'Run-time error '-2147467259 (80004005)':
'Automation error
'Unspecified error
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.InnerText
.Quit
MsgBox "IE.Quit ok"
End With
Set IE = Nothing
End Sub

"Barb Reinhardt" wrote:

I think I'd try this. I'm on XP, IE7 and Excel 2003.

Sub X()
'Need Microsoft Internet Controls reference selected
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Visible = True
With myIE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
Debug.Print .Busy
Debug.Print .ReadyState

DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set myIE = Nothing
End Sub

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Kevin" wrote:

The following code used to work - a year or two ago.

Sub X()
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
Do Until Not .Busy And .ReadyState < 4
DoEvents
Loop
ReturnURLcontent$ = .Document.Body.innerText
.Quit
End With
Set IE = Nothing
End Sub

Now I get the following error at the ReturnURLcontent$ line.
Run-time error '-2147467259 (80004005)':
Method 'Document' of object 'IWebBrowser2' failed

I've also tried the following.

Sub Y()
Const READYSTATE_COMPLETE& = 4&
Dim IE As Object
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Navigate "http://www.yahoo.com"
While Not .ReadyState = READYSTATE_COMPLETE
DoEvents
Wend
.Quit
End With
Set IE = Nothing
End Sub

I get the following error after the While Not... line
Run-time error '-2147417848 (80010108)':
Automation Error
The object invoked has diconeccted from its clients.

Any help with be greatly appreciated.

Thanks much.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 so slow in vista woodis Excel Discussion (Misc queries) 1 December 23rd 09 12:45 AM
Windows Vista and Excel 2000 -- incompatibility? Lindsay Graham Excel Discussion (Misc queries) 10 August 3rd 08 03:59 PM
Imported into Vista, how to delete 2000 Excel textbox? Hank Excel Discussion (Misc queries) 0 May 4th 07 11:17 PM
Excel 2000 and Vista Gerry Cornell Excel Discussion (Misc queries) 12 March 18th 07 11:56 PM
What are the difference between 2000, 2003 and Vista for Excel Use prakash New Users to Excel 2 December 1st 06 07:36 PM


All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"