Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming,comp.os.ms-windows.programmer.win32
|
|||
|
|||
![]()
I'm writing an application in C++ which will read a couple of
complicated text files and create an Excel worksheet containing data extracted from these files. In the process of testing, I got to the point where the program: - used CoCreateInstance() to create an instance of Excel and obtain an IUnknown interface - used QueryInterface() to obtain an IDispatch interface - used Invoke() to set the Visible property to TRUE At this point I can see an instance of Excel with no workbook visible on the computer. If I let this test version of the program go ahead and call Release() on each of the interfaces which it has obtained, the instance of Excel closes. This I take to be normal behavior of an automated application. After adding code to get an IDispatch interface to the Workbooks object and calling its Add method, the instance of Excel has a workbook containing three worksheets, just as if it had been started by clicking the Excel button. Now, however if the program proceeds to call Release() on each of the interfaces, Excel does not close. I have to manually close it by clicking its close button. Is this normal behavior? I'm concerned that I may have failed to release an interface although I can't see what that interface might be. I know that I have a IUnknown and IDispatch interfaces to the original Excel object, an IDispatch interface to the Workbooks member, and an IDispatch interface to the Workbook returned by the Add method. The program calls Release() for each of these. Is there anything else I should look for? -- Norm To reply, change domain to an adult feline. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I save an Excel 97-2003 version or 2007 version for Mac 200 | Excel Discussion (Misc queries) | |||
Macro - Save an Open Excel Version 4 as current version of Excel | Excel Programming | |||
Close Second Version of Excel file | Excel Discussion (Misc queries) | |||
downloaded version excel 2007 will not close normally when shut do | Excel Programming | |||
Recover earlier version of excel sheet after new version saved? | Excel Discussion (Misc queries) |