当我调用saveas()函数时,除最后保存的文件外,对文件所做的更改不会生效
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Open(AppDomain.CurrentDomain.BaseDirectory + "my_file.xlsx");
xlWorkSheet = xlWorkBook.Worksheets["sheet1"];
for (int i = 0; i < 10; i++)
{
xlWorkSheet.Cells[i, 1].value = i.ToString();
xlWorkBook.SaveAs(AppDomain.CurrentDomain.BaseDirectory + i.ToString);
}
xlWorkBook.Close(false, Type.Missing, Type.Missing);
xlApp.Quit();