When importing an XLSX that has "Date" number-formatted cells, and those cells have the 5-digit representation of th edate, XslxFormatProvider.Import(bytes) will throw a KeyNotFoundException. The exception message is "The given key '58' was not present in the dictionary" for the particular case we're looking at.
Unfortunately, we cannot provide the file itself, as it has PHI in it. And, when we open it in Excel and resave it, Excel will automatically convert the 5-digit representation to a normal date. This new file will import just fine. However, we're trying to cut out that intermediate step.
Pertinent portion of the stack trace:
at System.ThrowHelper.ThrowKeyNotFoundException[T](T key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.XlsxWorksheetImportContext.ImportDirectFormattingInRange(XlsxWorkbookImportContext workbookContext, FormattingRecord directFormatting, PropertyBagBase propertyBag, Int64 start, Int64 end)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.XlsxWorksheetImportContext.EndImport(XlsxWorkbookImportContext workbookContext)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.XlsxWorkbookImportContext.EndImport()
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider.ImportOverride(Stream input)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.WorkbookFormatProviderBase.Import(Stream input)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.BinaryWorkbookFormatProviderBase.Import(Byte[] input)
at .....