Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Webbrowser and DocumentComplete
I am using the DocumentComplete event to grab the text from a web
page. The MS documentation suggests of course I need to check the page has finally loaded. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is WB.Object) Then Debug.Print "Web document is finished downloading" End If End Sub When I try this it complains that "Object doesn't not support this property or method" What's wrong? grove |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Webbrowser and DocumentComplete
"grove" wrote in message
... I am using the DocumentComplete event to grab the text from a web page. The MS documentation suggests of course I need to check the page has finally loaded. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is WB.Object) Then Debug.Print "Web document is finished downloading" End If End Sub When I try this it complains that "Object doesn't not support this property or method" What's wrong? Is it because you are using "WebBrowser1" and "WB" in the same procedure? If that's not the reason, does this work? "If (pDisp Is WB) Then" Curiously "pDisp Is WB.Object" works in MSAccess, but not in my version of Excel -- roger |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Webbrowser and DocumentComplete
WebBrowser1 was just my typo when I was cutting and pasting to this
post. "If (pDisp Is WB) Then" Certainly does work and gives the correct result in my procedure, so seems an error in the documentation. Worrying that there appears to be some inconsistency with versions of Excel. If you have any ideas why, or find which is the correct syntax for your version, perhaps you would let me know. I am on Excel 2002 SP3. Thanks grove |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Webbrowser and DocumentComplete
"grove" wrote in message
... WebBrowser1 was just my typo when I was cutting and pasting to this post. "If (pDisp Is WB) Then" Certainly does work and gives the correct result in my procedure, so seems an error in the documentation. Worrying that there appears to be some inconsistency with versions of Excel. If you have any ideas why, or find which is the correct syntax for your version, perhaps you would let me know. I am on Excel 2002 SP3. Sorry, I don't know. I am using the same version of Excel. Perhaps it's one of the 1483279 bugs and features that nobody ever got around to fixing. -- roger |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Webbrowser and DocumentComplete
I probably need to start a new thread, but I will give it a try.
This code works fine in Excel 2002 Private Sub WB_DocumentComplete(ByVal pDisp As Object, URL As Variant) Dim sGetText As String If (pDisp Is WB) Then sGetText = WB.Document.Body.InnerText ....do something with sGetText ... End Sub But in Excel 2003 "sGetText" is empty for the same web page. Thanks grove |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Retain focus of IE using DocumentComplete | Excel Programming | |||
WebBrowser | Excel Programming | |||
a webbrowser popup | Excel Programming | |||
vba webbrowser HELP! | Excel Programming | |||
Need WebBrowser programming help | Excel Programming |