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 ();