Aspose.Cells for .NET 7.7.2 hangs when trying to open Excel file

Please see attached file and coding used. Program stops when instantiating new Workbook(oldName).



static bool SaveExcelFile(string oldName)

{

bool saveStatus;



var newName = oldName.Replace(“Inbox”, “Batch”);

var newFileInfo = new FileInfo(newName);

newName = newName.Replace(newFileInfo.Extension, “_pgnum.tif”);



try

{

var imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions

{

ImageFormat = ImageFormat.Tiff,

HorizontalResolution = 200,

VerticalResolution = 200,

TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionCCITT4,

OnePagePerSheet = true

};

var saveExcelWorkbook = new Aspose.Cells.Workbook(oldName);

var saveWorksheetColl = saveExcelWorkbook.Worksheets;

var wsCount = saveWorksheetColl.Count;



for (int ws = 0; ws
{

var sheet = saveWorksheetColl[ws];

if (sheet.Cells.Count == 0 || sheet.CodeName == “Look ups”

|| sheet.CodeName == “Instructions for use”

|| sheet.CodeName == “Internal Instructions”

|| sheet.CodeName == “Autouploader” || !sheet.IsVisible)

{

continue;

}

sheet.ViewType = Aspose.Cells.ViewType.NormalView;

var wsRender = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);

var saveName = newName.Replace(“pgnum", "” + ws.ToString(“00”));

wsRender.ToTiff(saveName);

}



saveStatus = true;

}

catch (Exception exc)

{

Console.WriteLine(“Exception converting Excel Doc to TIF - {0}”, exc.Message);

Log.Error(oldName, “Exception converting Excel Doc to TIF”, exc.Message);

saveStatus = false;

}

GC.Collect();



return saveStatus;

}

Hi Elizabeth,

Thank you for bringing this issue to us.

We are able to reproduce the problem while using the latest version of Aspose.Cells for .NET 7.7.2 and your provided spreadsheet. A ticket (CELLSNET-42390) has been logged in our bug tracking system to probe further into this matter. Please spare us little time to properly analyze the problem cause and to provide a fix at earliest. In the meanwhile, we will keep you posted with updates in this regard.

Please accept our apologies for your inconvenience.

Hi,

Thanks for your posting and using Aspose.Cells.

We have fixed this issue.

Please download and try the latest fix: Aspose.Cells for .NET 7.7.2.1 and let us know your feedback.

Yes, the updated module you have provided works very well. Thank you.

Hi Elizabeth,

Thank you for the confirmation. Please feel free to write back in case you face any difficulty or have any concerns. We will be glad to help you out.