Good, that you were able to create the one error – I also had this error when reducing the number of worksheets down to just the 2. I believe that if this issue is fixed there is a good chance it will also resolve the other, worse error of the StackOverflowException.
Workbook wb = new Workbook(myDir + “Product Capability Burndown MER 5.1.14_DAN.xlsm”);
Worksheet ws = wb.Worksheets[“B2-ProductView”];
PageSetup ps = ws.PageSetup;
ps.LeftMargin = 0;
ps.RightMargin = 0;
ps.TopMargin = 0;
ps.BottomMargin = 0;
ps.CenterHorizontally = true;
ps.CenterVertically = true;
ps.PrintArea = “A2:AI92”;
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
//Specify the image format
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
//Only one page for the whole sheet would be rendered
// – OBSOLETE imgOptions.IsImageFitToPage = false;
imgOptions.OnePagePerSheet = true;
imgOptions.IsImageFitToPage = true;
imgOptions.OnlyArea = true;
//Render the sheet with respect to specified image/print options
SheetRender sr = new SheetRender(ws, imgOptions);
//Render the image for the sheet
sr.ToImage(0, myDir + “output.png”); // CODE DIES HERE.
catch (Exception e)
- Operating System version
- Operating System Architecture (32bit/64bit)
- Target Framework
- Application Type
That is odd that you are not having the same issue.
I would like to also add…
I have verified each of my assemblies. I went back and created a single page aspx file with a single image and the call to the function above. When I use the wb.CalculateFormula I get the “unhandled exception of type ‘System.StackOverflowException’ occured in Aspose.Cells.dll”
I’m glad to hear you were able to repeat the issue. Thanks for continuing to look into this. Looking forward to the results.
Is there any estimate on when a fix for this issue will be resolved?
We are not averse to paying for priority or better support. Unfortunately this current issue is a complete show stopper for us and does not allow us to proceed. We had purchased another component only to find later it could not do what we needed. The Aspose solution actually comes very close with the exception of this Stack Overflow. This is preventing us from purchasing OEM licenses.
Thanks for the great support so far,
Thanks for your using Aspose.Cells.
Please download and try the latest fix: Aspose.Cells for .NET v22.214.171.124 and let us know your feedback.
After further investigation of your issue, we found and think the issue “CELLSNET-42651” may be caused by the fact that the default stack size of IIS is too small (256k only). It is not the issue of our component but due to too much small default stack size of IIS. .Please see the sample code for your reference and try to change your code accordingly:
private HttpPostedFileBase file;
public ActionResult Index(HttpPostedFileBase file, string mode)
this.file = file;
Thread t = new Thread(Calc, 1048576);
private void Calc()
if (file != null && file.ContentLength > 0)
var wbkMain = new Workbook(file.InputStream);
Hopefully it will fix your issue.
Hello, one more time… SUCCESS.
Thanks for your feedback and using Aspose.Cells.
It is good to know that you met with success in sorting out this issue after increasing the default stack size. Let us know if you are still encountering any issue, we will be glad to look into it and help you further.