Hi
I get Shape objects from one worksheet and put it into another worksheet using worksheet.Shapes.AddCopy(shape, shape.UpperLeftRow, shape.Top, shape.UpperLeftColumn,shape.Left);
In case when shape is OleObject with reference to Word file this method works without error. But when I try to open destination worksheet using MS Excel I get error dialog “We found a problem with some content in “filename.xls”…”. If I recover it OleObject is removed.
This issue is observed in Aspose.Cells v.19.10 and v.18.6. Below is a runnable code that reproduces this issue. Please find sample solution project and original xlsx file in attachment
using Aspose.Cells;
namespace AsposeOleObject
{
class Program
{
static void Main(string[] args)
{
var originalWorksheet = new Workbook(“C:\original.xlsx”, new LoadOptions()).Worksheets[0];
var workbook = new Workbook(FileFormatType.Xlsx);
var destinationworksheet = workbook.Worksheets.Add(“TestSheet”);
var shape = originalWorksheet.Shapes[0];
destinationworksheet.Shapes.AddCopy(shape, shape.UpperLeftRow, shape.Top, shape.UpperLeftColumn,shape.Left);
workbook.Save(“C:\destination.xlsx”);
}
}
}
OleObjectError.zip (236.2 KB)
Best Regards
Andriy