We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Assumption of writing xls files

Thread ID:

Created:

Updated:

Platform:

Replies:

13218 Apr 22,2004 10:41 PM UTC Apr 24,2004 05:04 AM UTC Windows Forms 1
loading
Tags: XlsIO
Greg
Asked On April 22, 2004 10:41 PM UTC

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

Administrator [Syncfusion]
Replied On 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 >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;