Another problem reading HTML-page

Oldfox

New Member
Joined
Jan 18, 2024
Messages
3
Office Version
  1. 2007
Platform
  1. Windows
Strange. I have two sites. One of them works ok and data is copied into Excel. The other site does not work . Run time error 462. The remote server does not exist or is unavailable.

There must something different in those two servers. Certificate? (just guessing)

VBA Code:
Sub ReadHtmlPage()

Dim IE As Object
Dim URL As String

Set IE = CreateObject("InternetExplorer.Application")

IE.Silent = True
IE.Visible = True
IE.FullScreen = False

URL = "https://heppa.hippos.fi/heppa/app?page=racing%2FRaceResults&service=external&sp=CF1703714400000&sp=CES" ' this does not work
'URL = "https://www.is.fi/supersaa/" ' this URL works

IE.Navigate URL
Application.Wait (Now + TimeValue("0:00:02"))

Do Until (IE.ReadyState = 4 And Not IE.busy)
   DoEvents
Loop

IE.ExecWB 17, 2
IE.ExecWB 12, 0

Application.Wait (Now + TimeValue("0:00:02"))

Worksheets("Data").Activate
ActiveSheet.Cells.Clear
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True

IE.Quit
Set IE = Nothing

End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
It seems to work for me. Maybe it's a timing issue? Try increasing the wait times.
 
Upvote 0
Thx. This is strange. I run the vba code in my laptop and it worked!
Laptop has win11 and the date of iexplorer.exe is 6.5.2022.
My pc has win10 and the date of iexplorer.exe is 15.11.2023.
I reset Internet Explorer security settings in my pc, still did not work.

I tried to rollback Internet Explorer to v10 but I failed in it. Any ideas how to rollback IE?
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,109
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top