About save method of Microsoft.Office.Interop.Excel.Workbook
Sample code.
Code:
Microsoft.Office.Interop.Excel.Workbook theWorkbook =
ExcelObj.Workbooks.Open(
"C:\\test.xls", 0, true, 5,
"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
0, true, null, null);
Microsoft.Office.Interop.Excel.Sheets sheets = theWorkbook.Worksheets;
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
Excel.Range rng1 = worksheet.get_Range("A1:A1", Type.Missing);
rng1.Value2 = "TestVal";
theWorkbook.Save();
when save method is called a message is prompt "A file named 'test.xls' already exists in this location. Do you want to replace it?"
I want to avoid that message, can anyone please help me how to do that.
Thanks,
Mushq
Re: About save method of Microsoft.Office.Interop.Excel.Workbook
Mushq, have you tried setting the DisplayAlerts property of the Excel object to false ¿