I had code that creates and IE object and opens a webpage, I write a black source file to my D drive and then populate that black text file with using the innerhtml property of IE. However this code now work in excel 2010 IE ver 9 at least the part where i'm trying to write the innerhtml. Below is the code with the line in question bolded
Also the error i get is
run-time error ;2147023179 (800706b5)
Automation error
The interface is unknonn
Sub AECO()
ThisWorkbook.Activate
Sheets("AECO").Select
Dim blankcell As Range
Set blankcell = Cells.Find(what:="", after:=Range("C1"), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns)
blankcell.Select
datestart = CDate(blankcell.Offset(1, -2).Value)
numdays = Date - datestart
dateend = datestart + numdays
If datestart = Date + 1 Then
Exit Sub
Else
For i = datestart To dateend
'Download the file..
Dim IE, oFS, oTS
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Silent = False
dayWEB = Day(i)
If dayWEB < 10 Then dayWEB = 0 & dayWEB
monthWEB = Month(i)
If monthWEB < 10 Then monthWEB = 0 & monthWEB
yearWEB = Year(i)
dateForWEB = yearWEB & monthWEB & dayWEB
IE.Navigate "https://services.tcpl.ca/cor/public/gdsr/GdsrAlbertaImperial" & yearWEB & monthWEB & dayWEB & ".htm"
Do While IE.readystate <> 4: Loop
Const thesourcefile = "GdsrAlbertaImperial.txt"
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oTS = oFS.CreateTextFile("C:\" & thesourcefile)
oTS.Write (IE.document.DocumentElement.Innerhtml)
oTS.Close
Bookmarks