Reading xlsx with a perticular chart results in infinite loop without any exception

I am trying to read the excel file (xlsx) attached, to a workbook using the code below


__________________________________________________________
                //Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(excelPath, FileMode.Open, FileAccess.Read, FileShare.Read);
            <span style="color:green;">//Instantiate a Workbook object that represents the existing Excel file</span>
           <span style="color: rgb(43, 145, 175);">Workbook</span> _workbook = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">Workbook</span>(fstream);</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"> 
            _fileName = excelPath.Substring(excelPath.LastIndexOf(<span style="color:#a31515;">@"\"</span>) + 1, excelPath.Length - (excelPath.LastIndexOf(<span style="color:#a31515;">@"\"</span>) + 1));

            fstream.Close();</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">___________________________________________________________________</pre><pre style="background-color: white;"><span style="font-family: Consolas; font-size: 13px;">The control never returns after the line </span></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">WorkBook _workbook = new WorkBook(fstream);</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">It doesnot return any exception. But I noted that the memory consumption increases exponentially at this line.</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><br></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><b>Version of Aspose.Cells : 7.3.4.3</b></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><b>.NET framework : 4</b></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><b>Excel file : 2013 saved as xlsx</b></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><b><br></b></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">Please try to give a quick workaround as the issue is critical and needs an urgent fix.</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><br></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">Thanks</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">-Padma</pre></div>

Hi Padma,

Thanks for your posting and using Aspose.Cells.

Please download and use the latest version: Aspose.Cells for .NET 8.0.2 it will fix your issue.

We have tested your file with the following code and it successfully opened the file and saved it in xlsx format. We have attached the output xlsx file for your reference.

Please note that your source file (demo.xlsx) does not open fine in MS-Excel 2007 and it crashes MS-Excel 2010 on closing. It opens fine in MS-Excel 2013 without any issue, so it seems, there might be something wrong with your file.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\demo.xlsx”;


Workbook workbook = new Workbook(filePath);


workbook.Save(filePath + “.out.xlsx”);


Thanks Shakeel for the quick response.


Is there a workaround to fix this problem other than upgradation. Like saving the file in some format ?
Because ,at this time we wont be able to upgrade to the next version.

Hi,

Thanks for your posting and using Aspose.Cells.

Could you manually re-create this file or open or re-save it using MS-Excel? I have opened it and re-saved it MS-Excel 2007 with Save As… menu command. Please try opening it (demo-2.xlsx) in your Aspose.Cells version and see if it fixes your issue.

You can also use demo.xlsx.out.xlsx instead because it opens and closes fine in MS-Excel 2010.