Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
InfragisticsWorksheetCell.GetText() throws exception for cell with custom format #/#### "SF"
posted

Hello,

I wanted to document an exception I am seeing when using the Excel library to read a specific custom cell format.

If an Excel cell has the following:

  • Value                                     .001
  • Custom Format                 #/#### "SF"
  • Excel displays                  1/1000 SF

Then reading the cell with InfragisticsWorksheetCell.GetText() throws the following exception:
System.InvalidOperationException was caught
HResult=-2146233079
Message=The cell's format string is invalid. To be notified of this when the FormatString is set, set Workbook.ValidateFormatStrings to True.
Source=Infragistics4.Documents.Excel.v18.1
StackTrace:
at Infragistics.Documents.Excel.WorksheetCellBlock.GetCellTextInternal(Worksheet worksheet, WorksheetRow row, Int32 rowIndex, GetCellTextParameters paramters, Object value)
at Infragistics.Documents.Excel.WorksheetCellBlock.GetCellTextInternal(WorksheetRow row, Int32 rowIndex, GetCellTextParameters paramters)
at Infragistics.Documents.Excel.WorksheetRow.GetCellTextInternal(WorksheetCellBlock cellBlock, GetCellTextParameters parameters)
at Infragistics.Documents.Excel.WorksheetCell.GetText(TextFormatMode textFormatMode)

The following file is a minimal spreadsheet that reproduces the issue with the custom format applied to cell A1:

Thanks for consideration of this issue, and your continued improvements and updates to the Winforms Excel library!

Cheers,
Ben

Parents
No Data
Reply
  • 7555
    Offline posted

    Hello Ben,

    Thank you for posting to our forum!

    I am able to reproduce InvalidOperationException when using the Excel library to read a specific custom cell format.

    I have submitted this development issue for further investigation (256891) and have created this case a private case where I will link this development issue and also provide you with further information.

    Please let me know if I can provide you with further assistance.

Children