PDA

View Full Version : IE Temp & memory or what??



omnibuster
12-15-2011, 12:03 PM
:banghead: What should i do?
This code will load the data from IE normal if previously used CCleaner or temp files are deleted from the IE browse history otherwise load the previous day's data e.g. old data?
I dont want run daily CCleaner and delete temp files.

Sub ANDD()
Dim IE As InternetExplorer
Dim IETbl As Object
Dim doc As Object
Dim colTR As Object
Dim colTD As Object
Dim tr As Object
Dim td As Object
Dim iRow As Long
Dim iCol As Long

Set IE = New InternetExplore
' Set IE = CreateObject("InternetExplorer.Application")

With IE
.Navigate "http://..."
IE.Visible = 1

Do Until IE.ReadyState = 4
Loop


For Each IETbl In IE.Document.all

If TypeName(IETbl) = "HTMLTable" And Left(IETbl.innertext, 12) = "xxx" Then
Set doc = IETbl
Set colTR = doc.getElementsByTagName("TR")
iRow = 1
For Each tr In colTR
Set colTD = tr.getElementsByTagName("TD")
iCol = 1
For Each td In colTD
If Right(td.innertext, 1) <> "%" Then
ActiveCell(iRow, iCol).Value = td.innertext
iCol = iCol + 1
End If
Next td
iRow = iRow + 1
Next tr
End If
Next IETbl

IE.Visible = False
IE.Quit
Set IE = Nothing
Set doc = Nothing
Set colTR = Nothing
Set colTD = Nothing
' MatchFound = 0
End With
End Sub