Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

some kind of document complete 2

Status
Not open for further replies.

alreadyinuse3000

Technical User
May 29, 2008
7
DE
hi there,

a couple weeks ago i postet a question about loading IE-Content into Excel.

My problem is now, that it doesnt load the content into the dashboard since the browser is not fully loaded. (failure 8010040)

When googeling for help I always found a codeline called DocumentComplete which is unfortunately for Delphi.

My question: Is there something for VBA as well?
(Do: Loop Until IEApp.busy = False doesnt work for ExecWB)

Sub scanner()

myUrl = "Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Navigate myUrl
Do: Loop Until IEApp.busy = False
Do: Loop Until IEApp.busy = False
IEApp.Visible = True

IEApp.Document.All.Search.Value = "je"

SendKeys "{TAB} + {Enter} + {Enter}", True

' Do: Loop Until IEApp.busy = False

IEApp.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT

ActiveSheet.PasteSpecial

End Sub




Many thanks
AIU
 
alreadyinuse3000,

[tt]While objIE.Busy: Wend
While objIE.Document.ReadyState <> "complete": Wend[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
What about this ?
Do: Loop Until IEApp.ReadyState = 4

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you both for your help.

I tried both "waiting-statements" (as well as my old one) but vba still gives me the error.(failure 8010040)

Even activating the HTML Object library didnt work?

Code:
Sub scanner()

myUrl = "[URL unfurl="true"]http://dict.leo.org/frde"[/URL]
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Navigate myUrl
Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.Busy = False
IEApp.Visible = True

IEApp.Document.All.Search.Value = "je"

SendKeys "{TAB} + {Enter} + {Enter}", True

Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.ReadyState = 4
While IEApp.Busy: Wend
While IEApp.Document.ReadyState <> "complete": Wend

IEApp.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT

Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.ReadyState = 4
While IEApp.Busy: Wend
While IEApp.Document.ReadyState <> "complete": Wend

ActiveSheet.PasteSpecial

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top