XLSX to PDF conversion in .NET

I have a few excel spreadsheets that are throwing an exception when sent to Groupdocs.Conversion. I have attached a few inside a zip file…

Consultant Time Tracker.zip (53.6 KB)

This is using Groupdocs.Convert .NET 19.5.0 installed in Visual Studio with NuGet. The xlsx files load into Microsoft Excel and LibreOffice fine.

Here is the exception that gets thrown with some stack trace:

System.Exception {System.ArgumentOutOfRangeException}

"Specified argument was out of the range of valid values."

at Aspose.Cells.CellsHelper.(StringBuilder , Int32 )
at Aspose.Cells.CellsHelper.(Int32 , Int32 , Int32 , Int32 )
at Aspose.Cells.AutoFilter.(Int32 , Int32 )
at Aspose.Cells.Tables.ListObject.(Int32 , Int32 )
at Aspose.Cells.Tables.ListObjectCollection.(Int32 , Int32 )
at Aspose.Cells.Cells.DeleteColumns(Int32 columnIndex, Int32 totalColumns, Boolean updateReference)
at Aspose.Cells.Cells.DeleteBlankColumns(DeleteOptions options)
at   .     ​(   , SaveOptions )
at   .     ​(   , SaveOptions )
at GroupDocs.Conversion.Handler.ConversionHandler.(   , SaveOptions )
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(Stream fileStream, String fileName, LoadOptions loadOptions, SaveOptions saveOptions)
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(Stream fileStream, String fileName, SaveOptions saveOptions)
at DocMoto.Services.Concrete.PreviewService.<>c__DisplayClass10_0.<PdfFromDocument>b__0()

@sgreenchl,

This issue is reproduced at our end. Hence, it has been logged in our internal issue tracking system with ID : CONVERSIONNET-3142. As we have any further update on this, we’ll notify you.

@sgreenchl,

Please try to use SpreadsheetLoadOptions and set SkipEmptyRowsProperty to false. This way you can do conversion for such spreadsheets.

SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions();
loadOptions.SkipEmptyRowsAndColumns = false;

Then pass loadOptions to conversionHandler.Convert.
var convertedDocumentPath = conversionHandler.Convert("input file", loadOptions, saveOptions);