mstrebl1990
09-09-2018, 12:35 PM
Hi everyone.
I have tried this code in Excel 13 and 16, and in neither does it return the html I am looking for. I am trying to extract a substring from it, which has worked on other websites, but I can't get the initial html to process. I have a UserForm with a command button that calls the code below, and a textbox called TextBox1. The lines I commented out are causing an error in excel 16. Here's the code:
Private Sub CommandButton1_Click()
'the_start
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
If Error.Number <> 0 Then
objIE.Quit
Set Obj.IE = Nothing
'GoTo the_start
End If
Loop Until objIE.readystate = 4
TextBox1.Text = objIE.document.body.innerHTML
End Sub
I tried showing the html in a msgbox but it's cut off and I am not sure if it's the correct html. I would really appreciate any help. Is there any other way to get the html for processing? It's a website specific issue, totally works for other websites.
Thanks everyone!!
Best,
Martin
I have tried this code in Excel 13 and 16, and in neither does it return the html I am looking for. I am trying to extract a substring from it, which has worked on other websites, but I can't get the initial html to process. I have a UserForm with a command button that calls the code below, and a textbox called TextBox1. The lines I commented out are causing an error in excel 16. Here's the code:
Private Sub CommandButton1_Click()
'the_start
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
If Error.Number <> 0 Then
objIE.Quit
Set Obj.IE = Nothing
'GoTo the_start
End If
Loop Until objIE.readystate = 4
TextBox1.Text = objIE.document.body.innerHTML
End Sub
I tried showing the html in a msgbox but it's cut off and I am not sure if it's the correct html. I would really appreciate any help. Is there any other way to get the html for processing? It's a website specific issue, totally works for other websites.
Thanks everyone!!
Best,
Martin