Results 1 to 3 of 3

Thread: innerHTML not returned?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,970
    Here your code quickly quit IE repeatedly, for ever looping.
    The the_start line should be:
    the_start:
    with a colon at the end.

    This worked for me, but you'll need a reference to MS Forms, which if there's a userform in your project you probably already have, but if you haven't the easiest way to do this is to add a userform to the project in the vbe and remove it straightaway!
    Private Sub CommandButton1_Click()
    Dim objIE As Object
    
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Top = 0
    objIE.Left = 0
    objIE.Width = 800
    objIE.Height = 600
    objIE.Visible = True
    'On Error Resume Next
    objIE.navigate ("https://bethematch.org/tcdirectory/index/35/")
    Do
      DoEvents
    Loop Until objIE.readystate = 4
    zzz = objIE.document.body.innerHTML
    Set myData = New DataObject
    myData.SetText zzz
    myData.PutInClipboard
    objIE.Quit
    End Sub
    I didn't set up a userform with a textbox, I put the data into the clipboard, so when the macro's finished you need to paste it into say, notepad.
    Last edited by p45cal; 09-09-2018 at 03:43 PM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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