我努力了:
while (System::Runtime::InteropServices::Marshal::ReleaseComObject(worksheet_instance) > 0) ;
workbook_instance->Close(true, "Dummy.xlsx", Missing::Value);
while (System::Runtime::InteropServices::Marshal::ReleaseComObject(workbook_instance) > 0) ;
workbook_instance->~Workbook();
exApp_instance->Quit();
exApp_instance->~Application();
但它不会终止 excel 应用程序(我仍然在任务管理器中看到它)。作为尝试,我想做类似的事情
workbook_instance = NULL;
但它不被接受。有什么建议吗?谢谢你。