Sample code.
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?"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();
I want to avoid that message, can anyone please help me how to do that.
Thanks,
Mushq




Reply With Quote