BUG: Memory leak occurs when you query an open Excel worksheet by using ActiveX Data Objects (ADO) (319998)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft OLE DB Provider for Jet 4.0
- Microsoft Excel 97 for Windows
- Microsoft Excel 2002
This article was previously published under Q319998 SYMPTOMS When you retrieve a Microsoft ActiveX Data Objects (ADO)
Recordset from an Excel worksheet that is open in Excel, a memory leak occurs
in the Excel process. Repeated queries may eventually cause Excel to run out of
memory and raise an error, or cause Excel to stop responding. RESOLUTION The memory used by the ADO queries cannot be reclaimed by
closing and releasing the ADO objects. The only way to release the memory is to
quit Excel. If possible, query the Excel worksheet only while the
file is not open in Excel. If the worksheet must remain open (for
example, to allow dynamic recalculation of worksheet values on an ongoing
basis) use one of the following methods to work around the behavior: Method 1- Use the SELECT INTO syntax of the Jet OLE DB Provider to
export the Excel data to a new worksheet.
For additional information about using the SELECT INTO syntax to export
data, click the following article number to view the article in the Microsoft Knowledge Base:
295646
How To Transfer Data from ADO Data Source to Excel with ADO
Method 2- Use the SaveCopyAs method of the Workbook object in the Excel object model to programmatically save the
open Excel file under a new name. You can then query the copy of the file that
you previously saved under a new name from the ADO application.
STATUSMicrosoft has
confirmed that this is a bug in the Microsoft products that are listed at the
beginning of this article.
REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
257819
How To Use ADO with Excel Data from Visual Basic or VBA
For additional information
about the use of performance counters from Visual Basic, click the following article number to view the article in the Microsoft Knowledge Base:
296526
INFO: Collecting Performance Data Using PDH APIs from Visual Basic
For additional
information about Excel export options, click the article numbers below to view
the articles in the Microsoft Knowledge Base: 247412 INFO: Methods for Transferring Data to Excel from Visual Basic
246335 How To Transfer Data from an ADO Recordset to Excel with Automation
Modification Type: | Minor | Last Reviewed: | 8/24/2004 |
---|
Keywords: | kbADO kbMemory kbPerformance kbProgramming kbbug kbIISAM kbJET kbnofix kbProvider KB319998 |
---|
|