View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 6
Default Excel Process Not Closed (C++) only after complete Application Shutdown

I have a code which automates few things to create an excel file. The
problem is that once its done and saves the file and closes it the
excel process still is running in the background. It terminates it
self after the app completely closes it's self.

here is a pice of my code:

================================================== =====
xlApp.SetUserControl(false);
xlApp.SetVisible(false);
wb = xlApp.GetWorkbooks();
_wb = wb.Add(covOptional);
ws = _wb.GetSheets();

//Automate some stuff...

_wb.SetSaved(TRUE);
_wb.SaveCopyAs(COleVariant(filePath));
_wb.Close(COleVariant(covFalse),COleVariant(filePa th),COleVariant((long)0));
wb.Close();
xlApp.Quit();
xlApp.ReleaseDispatch();
xlApp = NULL;
wb = NULL;
ws = NULL;
_ws = NULL;
_wb = NULL;

so am I terminating these in the wrong order? I've tryed different
ways...
This class is called from button event.