xiuxiu
asked on
After quiting excel using objApp.Quit();, 'excel' still appears in the task manager!!
Help anyone,
i am using the excel automation to read and write data.below is how the program goes when i have finished writing and ready to close my excel obj application
COleVariant VOptional((long)DISP_E_PAR AMNOTFOUND , VT_ERROR);
//Set the range value to the SAFEARRAY.
range.SetValue(COleVariant (saRet));
objApp.SetDisplayAlerts(FA LSE);
objSheet.SaveAs(m_csFilena me, VOptional, VOptional,
VOptional,VOptional,VOptio nal,
VOptional, VOptional,VOptional);
//close the safearray
saRet.Detach();
saRet.Destroy();
objApp.SetVisible(FALSE);
//to prevent having more than 1 excel in task manager
objApp.SetUserControl(TRUE );
m_bStartRecording = FALSE;
ReadRecordCount=0;
TRACE("m_bStartRecording == FALSE......end of recording");
range.ReleaseDispatch();
objBook.Close(COleVariant( (short)FAL SE), VOptional, VOptional);
objBook.ReleaseDispatch();
objBook = NULL;
//exits excel
objApp.Quit();
objApp.ReleaseDispatch();
objApp=NULL;
However after running the program above to close the excel file, the excel program still exist in the task manager.it is only upon closing my dialog box, the excel file no longer exist in the task manager.
the problem is crucial to me because i would like to open and read the excel file which i recorded data without the need to close my dialog box. concurrently this is not possible because there exist a ghost excel file in the task manager that stops me from opening other excel files.
i am using the excel automation to read and write data.below is how the program goes when i have finished writing and ready to close my excel obj application
COleVariant VOptional((long)DISP_E_PAR
//Set the range value to the SAFEARRAY.
range.SetValue(COleVariant
objApp.SetDisplayAlerts(FA
objSheet.SaveAs(m_csFilena
VOptional,VOptional,VOptio
VOptional, VOptional,VOptional);
//close the safearray
saRet.Detach();
saRet.Destroy();
objApp.SetVisible(FALSE);
//to prevent having more than 1 excel in task manager
objApp.SetUserControl(TRUE
m_bStartRecording = FALSE;
ReadRecordCount=0;
TRACE("m_bStartRecording == FALSE......end of recording");
range.ReleaseDispatch();
objBook.Close(COleVariant(
objBook.ReleaseDispatch();
objBook = NULL;
//exits excel
objApp.Quit();
objApp.ReleaseDispatch();
objApp=NULL;
However after running the program above to close the excel file, the excel program still exist in the task manager.it is only upon closing my dialog box, the excel file no longer exist in the task manager.
the problem is crucial to me because i would like to open and read the excel file which i recorded data without the need to close my dialog box. concurrently this is not possible because there exist a ghost excel file in the task manager that stops me from opening other excel files.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Moderator, my recommended disposition is:
Split points between: sudipta_pal and dc197
DanRollins -- EE database cleanup volunteer
Split points between: sudipta_pal and dc197
DanRollins -- EE database cleanup volunteer
Hear hear!
;-)
;-)
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
Experts: Post your closing recommendations! Who deserves points here?