Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Handling internet explorer memory leaks from Excel VBA
I use Internet Explorer (IE) (both 8 and 9) from Excel 2003 via VBA.
I run IE8 from Windows XP and IE9 from Windows Vista. (IE10 and IE11 are incompatible with Vista.) I make repeated use of an instance of IE with Public IE As SHDocVw.InternetExplorer _ ' Needs Tools/References/Microsoft Internet Controls .... If IE Is Nothing Then Set IE = CreateObject("InternetExplorer.Application.1") End If .... I need to download train fare information with about 400k accesses. Windows Task Manager shows 2 images names ieexplore.exe - a small one and a large one. The memory used by the large one gradually increases until it seizes. When it seizes, control is not given to Excel until there is manual interaction. On Vista, the failure is a message box after about an hour: ' Microsoft Windows ' Internet Explorer has stopped working ' A problem caused the program to stop working correctly. Windows will ' close the program and notify you if a solution is available. ' Close program I coded the following recursive asynchronous function helpful. It stops IE being used for more than 10 minutes. Private Sub saveSingleFares() If Not ActiveWorkbook.Saved Then IE.Quit Set IE = Nothing ActiveWorkbook.Save End If Application.OnTime EarliestTime:=Now + TimeValue("00:10:00"), _ Procedu="saveSingleFares" End Sub I will probably code something less brutal later. I would prefer code to look at the IE memory usage in making a decision on killing it. -- Walter Briscoe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Camera Tool Leaks memory stops VBA | Excel Programming | |||
Available resource limits, memory leaks and linked files | Excel Programming | |||
Huge Memory Leaks using ODBC Drivers from Excel to retrieve data | Excel Programming | |||
documented memory leaks in Excel 2003 or OWC11? | Excel Programming |