We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SheetRender ToImage throwing "Input string was not in a correct format" exception

I now gave a problem with my code, which was previously running fine, whereby when it iterates through some Excel workbooks and tries to generates images of them using the Aspose.Cells SheetRender object, it can only generate the first one. The 2nd time it tries, I get an “Input string was not in a correct format” exception.

The code in question is:

Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);
Image image = sr.ToImage(0);

If I check sr.PageCount(), it returns ‘1’, so the SheetRender thinks it has an image.

I have tried to re-create this problem in a small test app, but that works fine (both are running in VS2008 with Aspose.Cells version

Can you please tell me what could be causing this particular exception to be thrown at this time, so that I can try to track down what could be causing it?




Well, your issue might be due to your code/logic that you are trying. I am afraid, unless we got your runnable sample application (you may zip it prior attaching here) to reproduce the issue on our end, we cannot evaluate your issue properly. The exception "Input String was not in a correct format… " has many applications which can also occur while loading some invalid or corrupts workbooks/files. Anyways, this exception can occur for different functionality/features for different scenarios too.

Thank you.