此代码在后台打开 excel,在 Windows 7 和 8 上没有问题,但在 Windows 10 上它会弹出“另存为”提示。您知道如何摆脱“另存为”提示吗?
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
//xlApp.Visible = false; // this does not help to get rid of save as
//xlApp.DisplayAlerts = false; // this does not help to get rid of save as
//xlApp.ScreenUpdating = false; // this does not help to get rid of save as
xlWorkBook = xlApp.Workbooks.Open(excelFileURL, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
xlWorkSheet = xlWorkBook.Worksheets.get_Item(1);