Aspose.Cells unable to load xlsx file

We are facing below exception while trying to open the shared xlsx file.

Exception.Message : Invalid IconSetType val

Exception.Source : Aspose.Cells

Exception.StackTrace :
at e.Warning(WarningInfo )
at .()
at .(Workbook , LoadOptions , Boolean )
at .(Stream )
at .(String , Stream , LoadOptions )
at Aspose.Cells.Workbook.(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file, LoadOptions loadOptions)

Exception.InnerException : null

CP_Sample.zip (14.2 KB)

@casepoint.networkstaff

It looks like you’re encountering an “Invalid IconSetType val” exception when trying to load an XLSX file using Aspose.Cells. This error typically indicates that there may be issues with the Excel file’s content or format.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Check for Corruption: The file might be corrupt. Try opening it in Excel and see if there are any warnings or errors. If Excel can recover it, save it again and then try loading it with Aspose.Cells.

  2. Use LoadOptions: When loading the workbook, consider using the LoadOptions class to specify how errors should be handled and to check for any warnings during the loading process. You can implement the IWarningCallback interface to capture any warnings that occur while loading the file.

    Here’s a basic example of how to use LoadOptions with a warning callback:

    using Aspose.Cells;
    using System;
    
    class WarningCallback : IWarningCallback
    {
        public void Warning(WarningInfo warningInfo)
        {
            Console.WriteLine($"Warning: {warningInfo.Description}");
        }
    }
    
    public void LoadWorkbook(string filePath)
    {
        LoadOptions options = new LoadOptions();
        options.WarningCallback = new WarningCallback();
    
        Workbook workbook = new Workbook(filePath, options);
    }
    
  3. Update Aspose.Cells: Ensure that you are using the latest version of Aspose.Cells, as the issue may have been fixed in a more recent update.

  4. File Format: Verify that the file is indeed an XLSX format and not a different format that has been renamed.

If the problem persists after these steps, you might want to reach out to Aspose support with the file in question for more specific assistance.

Let me know if you need further help!

Sources:
[1]: LoadOptions.CheckExcelRestriction | Aspose.Cells for .NET API Reference
[2]: Get Warnings while Loading Excel File with C++|Documentation

@casepoint.networkstaff
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-58607

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.

@casepoint.networkstaff,

This is to inform you that your issue (Ticket ID: “CELLSNET-58607”) has been resolved, so you won’t get any exception when loading the XLSX file. The fix will be included in the upcoming release (Aspose.Cells v25.7) that we plan to release in the first half of July 2025. You will be notified when the next version is published.

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