Results 1 to 3 of 3

Thread: Need Help about Webbrowser

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    38

    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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    38

    Re: Need Help about Webbrowser

    Guys, please anyone help. Cannot open the .exe file i made.
    vb Code:
    1. Private Sub Form_Load()
    2. WebBrowser1.Navigate ("http://free.timeanddate.com/clock/i1wtsrdx/n2/fn5/fs28/tcddd/ftb/bas5/bat6/baceee/pa2")
    3. End Sub
    4. Private Sub Command1_Click()
    5. Timer1.Enabled = True
    6. Dim ans As String
    7.     ans = InputBox("TIME??", "", "12:11:22 PM")
    8.     If ans = "" Then
    9.         Label1.Caption = "No message"
    10.     Else
    11.         Label1.Caption = ans
    12.     End If
    13. End Sub
    14.  
    15. Private Sub Timer1_Timer()
    16. Timer1.Enabled = True
    17. If WebBrowser1.Document.body.innerText = Label1.Caption Then
    18.  Dim Retval
    19. Retval = Shell("C:\WINDOWS\System32\MASTER.exe", 1) 'Run Master'
    20.  End If
    21. 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
  •  



Click Here to Expand Forum to Full Width