Error working with certain embedded objects

Using Aspose.Cells 7.5 and working with the attached spreadsheet, exceptions are thrown when either attempting to access the embedded ole object data (OverflowException), or saving the spreadsheet to PDF (CellsException). Is there any way to correct or work around theses issues? The primary concern is to still be able to render a PDF, even if certain embedded data is omitted.


Here is the repro code:

public void Test(string sourcePath)
{
var workbook = new Workbook(sourcePath);

foreach (Worksheet sheet in workbook.Worksheets)
{
foreach (OleObject obj in sheet.OleObjects)
{
try
{
if (obj.ImageData != null) //throws
{
Console.WriteLine("Embedded object image format: " + obj.ImageFormat);
}
}
catch (Exception ex)
{
Console.WriteLine("Unable to access ole image data " + ex.GetType().Name + ": " + ex.Message);
}
}
}

try
{
workbook.Save(sourcePath + “.pdf”, SaveFormat.Pdf);
Console.WriteLine(“Save to PDF successful”);
}
catch (Exception ex)
{
Console.WriteLine("Unable to save Excel to PDF " + ex.GetType().Name + ": " + ex.Message);
}
}

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to replicate the exception using the following code. When the following code is executed, it throws exception. We have logged this issue in our database. We will look into it and fix this issue. Once, the issue is fixed or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-41767.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\Sweetwater_129+MW_13June00_Breakeven.xls”;


Workbook workbook = new Workbook(filePath);


workbook.Save(filePath + “.out.pdf”,SaveFormat.Pdf);



Exception:
An unhandled exception of type 'Aspose.Cells.CellsException' occurred in AsposeProject.exe

Additional information: Shape to image Error!

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.5.0.4 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-41767) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.