📜  releaseObject - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:39.877000             🧑  作者: Mango

代码示例1
Excel._Application app = new Excel.Application();
Excel._Workbook workbook = app.Workbooks.Add(Type.Missing);
Excel._Worksheet worksheet = null;
app.Visible = true;

worksheet.Cells[1, 1] = "test string";

workbook.SaveAs("C:\testfile.xlsx");

object misValue = System.Reflection.Missing.Value;
workbook.Close(true, misValue, misValue);
app.Quit();

releaseObject(worksheet2);
releaseObject(workbook);
releaseObject(app);