Home > Software engineering >  MFC finish operation excel table release object, why still can't normal open the excel table
MFC finish operation excel table release object, why still can't normal open the excel table

Time:10-29

As shown in figure, I after operation the excel table, release all objects, why still can't normal open the excel table

CodePudding user response:

The call order,

 
Sheet. ReleaseDispatch ();
Sheets. ReleaseDispatch ();
COleVariant vNoChange ((long), 1);
COleVariant vFileName ((_bstr_t) strFileName);
Book. Close (vNoChange vFileName, covFalse);
Book. ReleaseDispatch ();
Books. ReleaseDispatch ();
ExcelApp - & gt; The Quit ();
ExcelApp - & gt; ReleaseDispatch ();

  • Related