|
-
June 11th, 2008, 04:24 AM
#1
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
Last edited by HanneSThEGreaT; June 12th, 2008 at 04:22 AM.
-
June 12th, 2008, 04:36 AM
#2
Re: About save method of Microsoft.Office.Interop.Excel.Workbook
Mushq, have you tried setting the DisplayAlerts property of the Excel object to false ¿
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|