Link to home
Start Free TrialLog in
Avatar of xiuxiu
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_PARAMNOTFOUND, VT_ERROR);
  //Set the range value to the SAFEARRAY.
  range.SetValue(COleVariant(saRet));
  objApp.SetDisplayAlerts(FALSE);
  objSheet.SaveAs(m_csFilename, VOptional, VOptional,
               VOptional,VOptional,VOptional,
                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)FALSE), 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.

ASKER CERTIFIED SOLUTION
Avatar of sudipta_pal
sudipta_pal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CleanupPing
CleanupPing

xiuxiu:
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?
Avatar of DanRollins
Moderator, my recommended disposition is:

    Split points between: sudipta_pal and dc197

DanRollins -- EE database cleanup volunteer
Hear hear!
;-)