|
-
Jan 3rd, 2007, 03:51 AM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] How to get around error 91
Hey folks, I've been working on adding a couple of search engines to my IE clone, but everytime i run the program, i always get this msg
Object reference not set to an instance of an object. Error Number: 91
the documentation on .GetElementById and .InvokeMember is sketchy at best, i've tried msdn, this forum, google, and all the other tricks i know, can anyone help?
Here's my code
VB Code:
Private Sub doSearchQuery()
Dim google As String = "http://www.google.com/search?hl=en&q=" 'Google's search engine string
Dim yahoo As String = "http://search.yahoo.com/search;_ylt=A0geuoxASo1FZw4AFj2l87UF?ei=UTF-8&fr=sfp&p=" 'Yahoo's search engine string
Dim googleId As String = "btnG"
Dim Click As String = "click"
'Dim helement As New HtmlElement
Try
If lbSearchSelect = "Google" Then
wbPKMN.Navigate(google & SearchString) 'Navigate to google
wbPKMN.Document.GetElementById("btnG").InvokeMember(Click)
Else
wbPKMN.Navigate(yahoo & SearchString) 'navigate to yahoo
wbPKMN.Document.GetElementById("yschqcon").InvokeMember(Click)
End If
Catch ex As Exception
nwWriteLogMsg(ex.Message, ".\nwpps2k6err.log", ex.StackTrace, ex.TargetSite.ToString, ex.Source, ex.HelpLink)
With frmException
.lblTitle.Text = "UriFormatException"
.txtDesc.Text = ex.Message & " Error Number: " & Err.Number
.lblSource.Text = ex.Source
.lblTargetMethod.Text = ex.TargetSite.ToString
.ctbSTrace.Text = ex.StackTrace
.ShowDialog(Me)
End With
End Try
LbSearch.Hide()
End Sub
The funny thing about this is, it works, even though it's throwing that error everytime. Just wonder if there's a way around it
Redmo
Last edited by redmo; Jan 3rd, 2007 at 03:59 AM.
Reason: Including whole code block
The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp
Please rate the posts that have helped. Makes us feel all warm and fuzzy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|