المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Interop: Anyone know how to save an Excel workbook without the "Do you want to save" popup?



C# Programming
11-16-2011, 07:20 PM
Does anyone know the incantation to save an excel workbook without having the "Do you want to save" popup appearing? I cannot have the confirmation appear because the alterations I am making to the file need to be seamless.

Application excel = new Application(); Workbook workbook = excel.Workbooks.Open(Filename); var sheet = workbook.ActiveSheet; Range column = sheet.Range["B1"].EntireColumn; column.Insert(XlInsertShiftDirection.xlShiftToRight); workbook.Save(); //workbook.SaveAs(Filename); workbook.Close(); Marshal.ReleaseComObject(workbook); Marshal.ReleaseComObject(excel); This will save the file, but the popup is not suppressed.
"I need build Skynet. Plz send code"