Article ID: 132535 - View products that this article applies to.
This article was previously published under Q132535
The CREATEOBJECT function can be used to create a reference to an instance of Microsoft Excel and assign that reference to a variable. However, releasing that variable does not cause the instance of Excel to quit.
Inadvertently creating multiple instances of Excel can cause a variety of error messages, depending on the machine configuration and Windows version. These error messages include:
"Not enough memory"
If you are running Microsoft Excel 5.0, use the following code to close all instances of Microsoft Excel:
If you are using Microsoft Excel 7.0, use the following code:
The code is different because Microsoft Excel 95 contains a bug that was corrected in later versions.
If you are using Microsoft Office 2000 or Microsoft Office XP change the following code:
to the following:
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
153025NOTE: The DECLARE statements in the above example are case-sensitive and the functions must be called just as in the example.
(http://support.microsoft.com/kb/153025/EN-US/ )FIX: Microsoft Excel 95 Doesn't Respond Correctly toGetObject
Steps to Reproduce BehaviorRun the following code to create five instances of Microsoft Excel, none of which are visible:
Releasing the variable x does not terminate the instance of Microsoft Excel. To ensure that each instance is terminated, add the following command immediately before the RELEASE x command:
To test if an instance of Microsoft Excel exists use this function:
This returns an OLE error if no instance of Microsoft Excel is in memory.