Converting older Excel spreadsheets to PDF

Hi Aspose team,

We’re trying to convert and older Excel file, but Aspose.Cells throws the following exception:
“This Excel files contains (Excel95 or earlier file format) records.”

Here is our code:
Aspose.Cells.Workbook excelDoc = null;
try
{
excelDoc = new Aspose.Cells.Workbook(filename);
}
catch (System.Exception ex)
{
FileStream stream = new FileStream(filename, FileMode.Open);
// Instantiate LoadOptions specified by the LoadFormat.
Aspose.Cells.LoadOptions loadOptions1 = new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Excel97To2003);

// Create a Workbook object and opening the file from the stream
excelDoc = new Aspose.Cells.Workbook(stream, loadOptions1);

}

We also tested this code which seems to be causing a complete hang situation:
Aspose.Cells.Workbook excelDoc = null;
try
{
excelDoc = new Aspose.Cells.Workbook(filename);
}
catch (System.Exception ex)
{
Aspose.Cells.LoadOptions loadOptions1 = new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Excel97To2003);
excelDoc = new Aspose.Cells.Workbook(filename, loadOptions1);
}

Do you have a proposal on how to successfully load this .xls and save to pdf ?
Sample file:
Gebyrskjema_8.zip (1.1 KB)

Thanks in advance !

@andersalvsaker,

Thanks for the template XLS file.

After an initial testing, I was able to reproduce the issue as you mentioned by using your template XLS file. I found an exception “This Excel files contains (Excel95 or earlier file format) records” when opening the older Excel XLS file.

// Get the Excel file into stream
using (FileStream stream = new FileStream("e:\\test2\\Gebyrskjema_8.xls", FileMode.Open))
{
    // Instantiate LoadOptions specified by the LoadFormat.
    Aspose.Cells.LoadOptions loadOptions1 = new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Excel97To2003);

    // Create a Workbook object and opening the file from the stream
    Workbook wbExcel95 = new Workbook(stream, loadOptions1);

Workbook workbook = new Workbook("e:\\test2\\Gebyrskjema_8.xls", loadOptions1);
}

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-56110

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@andersalvsaker,

This is to inform you that the issue (“CELLSNET-56110”) has been successfully resolved. The fix/enhancement will be incorporated in the upcoming release (Aspose.Cells v24.7) planned for publication in the next week of July (hopefully). You will receive a notification in this thread upon the release of the next version.

1 Like

Thank you for super quick handling of this issue :+1:t2::sweat_smile:

@andersalvsaker,

You are welcome.

The issues you have found earlier (filed as CELLSNET-56110) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

1 Like