I have a couple of Excel files that I am able to convert to TIFF with no problem in 126.96.36.199, but in 188.8.131.52 I get an “Object not set to an instance of an object” error on every sheet. The Excel files are attached.
Please use SheetRender API instead of SheetToImage, we do not enhance SheetToImage anymore now. Please try the attached latest version/fix with the following sample code. I have tested using your file and it works fine.
Workbook workbook = new Workbook();
ImageOrPrintOptions sheetOptions = new ImageOrPrintOptions();
sheetOptions.ImageFormat = ImageFormat.Tiff;
sheetOptions.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionLZW;
sheetOptions.HorizontalResolution = 300;
sheetOptions.VerticalResolution = 300;
sheetOptions.IsCellAutoFit = true;
for (int ix = 0; ix < workbook.Worksheets.Count; ++ix)
Worksheet worksheet = workbook.Worksheets[ix];
SheetRender sr = new SheetRender(worksheet, sheetOptions);
int sheetPageCount = sr.PageCount;
string subPageName = string.Empty;
for (int j = 0; j < sheetPageCount; j++)
sr.ToImage(j, @“e:\test\image” + ix.ToString() + “_” + j.ToString() + “.tif”);
catch (Exception sheetException)
// TODO: log this exception
// do nothing; this sheet has a problem, continue exporting the other sheets
Thank you for your reply. Using SheetRender.ToTiff in 184.108.40.206, I am now able to convert the previous Excel file. However, Excel files with blank worksheets result in the blank worksheet being converted to 0KB Tiff images; these blank worksheets should either be ignored or converted into blank Tiff images, rather than a zero-length file.
Please try the attached latest fix v220.127.116.11 instead of v18.104.22.168. I have tested with your template file, the tif files are generated fine. The tif images results are same as Ms Excel’s print preview. If you find any difference, kindly let us know.