and I believe that there is an optional parameter to the close method
that says 'save changes' or prompt to save changes.
if you open up Excel, and you go.. Tools, Visual C# Editor.
OH WAIT A SECOND, C# IS FOR ****ING FAGS AND DOESNT WORK WITH MS
OFFICE DOES IT??
On Feb 13, 10:38 pm, David <D...@discussions.microsoft.com> wrote:
> Hello,
>
> How can I disable that message/question that appears when my program edits
> an Excel file?
>
> Here's the code:
>
> Excel.Application excelApp = new Excel.ApplicationClass();
> Excel.Workbook excelWorkbook = excelApp.Workbooks.Open( fileName, 0, false,
> 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true,
> false, false);
> Excel.Sheets excelSheets = excelWorkbook.Worksheets;
> Excel.Worksheet excelWorksheet =
> (Excel.Worksheet)excelSheets.get_Item("Sheet1");
> excelWorksheet.get_Range("A1", "A1").Value2 = "'Testing";
> excelWorksheet.get_Range("A2", "A2").Value2 = "'Example";
> etc. etc.
> excelApp.Workbooks.Close();
>
> The question that appears (from Excel) is the following "Do you want to save
> changes you made to <filename>?"
>
> Any ideas?
>
> Thanks,
>
> David
|