The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
It appears that more focus has been placed on creating xls files than reading them.
After I read and
ExcelUtils.CloseWorkBook();
Excel informs me that I have written to the xls file with an older version of Excel. Also, the file datestamp also indicates a write has been performed.
Please tell me how to Open a workbook file in read-only mode, or Close a workbook without writing to it.
Thanks,
Greg
ADAdministrator Syncfusion Team April 24, 2004 05:04 AM UTC
Hi Greg,
Sorry for the delay in responding. The ExcelUtils.Closeworkbook method saves the changes in the active workbook. This will be corrected in the next release to have an overload to not save changes.If you do not want to save the changes you can use the following code snippet. Please note that this code snippet uses Direct ExcelRW API. ExcelUtils is just a wrapper around the most commonly used direct API.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook myWorkbook = ExcelEngine.Excel.Workbooks.Open("Template.xls");
IWorksheet mySheet = myWorkbook.Worksheets[0];
//Closes the workbook without saving changes. There are overloads for saving changes.
myWorkbook.Close();
excelEngine.ThrowNotSavedOnDestroy = false;
excelEngine.Dispose();
Please let me know if that doesnt help. Thank you for your co-operation.
Best regards,
Stephen.
>It appears that more focus has been placed on creating xls files than reading them.
>
>After I read and
>ExcelUtils.CloseWorkBook();
>
>Excel informs me that I have written to the xls file with an older version of Excel. Also, the file datestamp also indicates a write has been performed.
>
>Please tell me how to Open a workbook file in read-only mode, or Close a workbook without writing to it.
>
>Thanks,
>Greg
>