|
-
Feb 16th, 2010, 09:17 PM
#1
Thread Starter
Member
Need Help about Webbrowser
Hello Guys,
I cant make it work, i want when the set text is received by webbrowser which is from label1, then it PoPUP message, "SET TEXT IS FOUND". But it is not happening. Please help.
Code:
Private Sub Form_Load()
WebBrowser1.Navigate ("http://free.timeanddate.com/clock/i1wtsrdx/n2/fn5/fs28/tcddd/ftb/bas5/bat6/baceee/pa2")
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Dim ans As String
ans = InputBox("TIME??", "", "6:04:22 AM")
If ans = "" Then
Label1.Caption = "No message"
Else
Label1.Caption = ans
End If
End Sub
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
If WebBrowser1.Document.body.innerText = Label1.Caption Then
MsgBox "SET TEXT IS FOUND"
End If
End Sub
-
Feb 17th, 2010, 01:57 AM
#2
Re: Need Help about Webbrowser
i don't believe the webbrowser status is changed when the time updates, better to put the code in your timer
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 17th, 2010, 04:37 AM
#3
Thread Starter
Member
Re: Need Help about Webbrowser
Guys, please anyone help. Cannot open the .exe file i made.
vb Code:
Private Sub Form_Load() WebBrowser1.Navigate ("http://free.timeanddate.com/clock/i1wtsrdx/n2/fn5/fs28/tcddd/ftb/bas5/bat6/baceee/pa2") End Sub Private Sub Command1_Click() Timer1.Enabled = True Dim ans As String ans = InputBox("TIME??", "", "12:11:22 PM") If ans = "" Then Label1.Caption = "No message" Else Label1.Caption = ans End If End Sub Private Sub Timer1_Timer() Timer1.Enabled = True If WebBrowser1.Document.body.innerText = Label1.Caption Then Dim Retval Retval = Shell("C:\WINDOWS\System32\MASTER.exe", 1) 'Run Master' End If End Sub
It gives error :
Run-time error '91': Object variable or with block variable not set
Please help Guys.
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
|