Results 1 to 10 of 10

Search HTML source code for text

Threaded View

davegugg Search HTML source code for... 10-21-2009, 04:03 PM
Leith Ross Re: Search HTML source code... 10-21-2009, 07:13 PM
davegugg Re: Search HTML source code... 10-22-2009, 12:23 PM
Leith Ross Re: Search HTML source code... 10-22-2009, 01:55 PM
davegugg Re: Search HTML source code... 10-22-2009, 02:24 PM
Leith Ross Re: Search HTML source code... 10-22-2009, 02:31 PM
davegugg Re: Search HTML source code... 10-22-2009, 02:50 PM
davegugg Re: Search HTML source code... 10-22-2009, 05:10 PM
Leith Ross Re: Search HTML source code... 10-22-2009, 06:19 PM
davegugg Re: Search HTML source code... 10-23-2009, 10:54 AM
  1. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Search HTML source code for text

    Hello Dave,

    The workbok now contains 2 links. One in "A1" and another in "A2". I checked "A1" and it is no longer on the Google page. The link in "A2" is valid. I added a button to call the macro. When the macro is run from the VBIDE, the message box appears while Internet Explorer is active. The message box appears behind Excel while Internet Explorer is active. The message box now is displayed after IE is closed. Here is the updated code. These changes have been made to the attached workbook,
    Sub CheckLink()
    
      Dim IEapp As Object
      Dim IEdoc As Object
      Dim Href As String
      Dim Msg As String
      Dim Res As Variant
      Dim Site As String
      
        Site = "www.google.com"
        Href = Range("A2")
        
        Set IEapp = CreateObject("InternetExplorer.Application")
        IEapp.Navigate Site
        
          While IEapp.Busy
            DoEvents
          Wend
          
          Set IEdoc = IEapp.Document
          
          For Each Item In IEdoc.Links()
            Res = InStr(1, Item.outerhtml, Href)
            If Res Then
               Msg = "Link has Not Changed"
               GoTo Finish
            End If
          Next Item
          
          Msg = "Link has been Updated."
          
    Finish:
        IEapp.Quit
        Set IEapp = Nothing
        Set IEdoc = Nothing
        MsgBox Msg
        
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1