Thursday, 15 September 2011

c# - Excel file not loaded correctly -



c# - Excel file not loaded correctly -

i using gembox-spreadsheet parse excel files multiple sheets.

i loading file using next code:

excelfile.loadxlsx(inputexcel, xlsxoptions.none);

where inputexcel fullpath. after importing excel, seek access content (for each sheet, parse rows , obtain cell data). problem here after loading document, in debug mode if check values in sheet, see error:

'excelfile.worksheets.activeworksheet.cells.value' threw exception of type 'system.invalidoperationexception'.

however, when seek retrieve info cell (which contains info, doesn't matter of type) retrieves 0.

does know why error occurs , how can prevent it?

i must mention values in cells generated through formulas, separate worksheet. why values not loaded?

well, found problem. because cell values obtained through formulas, when loading file must set xlsxoptions.preserveworksheetrecords (for xls) or xlsoptions.preservekeepopen (for xlsx)

c# gembox-spreadsheet

No comments:

Post a Comment