I need to read the data from an excel file (not formatted) and in order to do this I need to find a cell that contains a specific text.
I am trying to do this
FindOptions options =
new
FindOptions()
{
FindWhat =
"Record"
,
MatchEntireCellContents =
true
};
but it fails with:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Documents.Spreadsheet.Utilities.FindAndReplaceHelper.MoreThan(WorksheetCellIndex left, WorksheetCellIndex right, FindBy searchBy)
at Telerik.Windows.Documents.Spreadsheet.Utilities.FindAndReplaceHelper.<>c__DisplayClass3_0.<OrderResults>b__0(FindResult result)
at System.Linq.Enumerable.TakeWhileIterator[TSource](IEnumerable`1 source, Func`2 predicate)+MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at Telerik.Windows.Documents.Spreadsheet.Utilities.FindAndReplaceHelper.OrderResults(FindOptions findOptions, IEnumerable`1 findResults)
at Telerik.Windows.Documents.Spreadsheet.Model.Workbook.Find(FindOptions findOptions)
While looking in the code I have discovered that is because the StartCell is null. Where does it say that the StartCell is mandatory? Also why is the StartCell mandatory?