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)
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