I am using Aspose.Cells .Net to convert an Excel worksheet into a PNG. For many workbooks it works OK, but for some I get “Object reference not set to an instance of an object.” when trying to produce a bitmap.
xlBook = New Workbook(sFName)
Dim opts As ImageOrPrintOptions = New ImageOrPrintOptions
opts.ImageType = Aspose.Cells.Drawing.ImageType.Png
Dim ws As Worksheet = xlBook.Worksheets(0)
Dim sr As SheetRender = New SheetRender(ws, opts)
Dim bitmap As Bitmap = sr.ToImage(1)
bitmap.Save(sFileSrvPath & sImgOutFName)
The error occurs on bitmap.Save. Thanks for your help!