Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2000 so slow in vista | Excel Discussion (Misc queries) | |||
Windows Vista and Excel 2000 -- incompatibility? | Excel Discussion (Misc queries) | |||
Imported into Vista, how to delete 2000 Excel textbox? | Excel Discussion (Misc queries) | |||
Excel 2000 and Vista | Excel Discussion (Misc queries) | |||
What are the difference between 2000, 2003 and Vista for Excel Use | New Users to Excel |