Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
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
Retain focus of IE using DocumentComplete George J[_3_] Excel Programming 1 January 20th 08 09:54 PM
WebBrowser joe black Excel Programming 0 March 4th 07 10:56 PM
a webbrowser popup scott[_10_] Excel Programming 0 February 4th 06 08:24 PM
vba webbrowser HELP! Brian Delaney Excel Programming 2 August 7th 05 04:38 PM
Need WebBrowser programming help Neil Law Excel Programming 0 May 6th 05 03:29 PM


All times are GMT +1. The time now is 09:48 PM.

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"