I want to update the ObjectSourceFullName of an OLE object, but the change is not effected.
To reproduce:
1. Copy and extract the attached zip file to c:\temp. The 2 images should be in the c:\temp\images folder, and Book1.xlsx in c:\temp
2. Run the Test() method below
3. Look at the c:\temp\Book1 - Updated.xlsx and notice that the OLE object still points to the original image instead of test.bmp.
In addition to fixing the bug, is there a workaround I can use now to get this working?
public static void Test()
{
// AsposeLicenseManager.License(XlsFileHandler.License, stream => XlsFileHandler.License.SetLicense(stream));
string filePath = @“C:\Temp\Book1.xlsx”;
var asposeOptions = new Aspose.Cells.LoadOptions { MemorySetting = MemorySetting.MemoryPreference };
var wb = new Workbook(filePath, asposeOptions);
//var o = wb.Worksheets[0].Shapes[0] as OleObject; //also does not worth
var o = wb.Worksheets[0].OleObjects[0];
var updatedPath = @“c:\temp\Images\test.bmp”;
o.ObjectSourceFullName = updatedPath;
o.UpdateSelectedValue();
var filePath2 = filePath.Replace(@“Book1”, @“Book1 - Updated”);
wb.Save(filePath2);
}