Aspose.Words and linked Excel Chart objects

Excel Chart objects can be linked into Word parent file as:

  1. Excel Chart Object ExcelChartObject.png (15.5 KB)
  2. Graphic Object GraphicObject.png (15.5 KB)

If the Excel Chart is inserted as Excel Chart Object I can manipulate it using Aspose.Words.
The link to the excel file holding the chart is exposed through Shape.OleFormat.SourceFullName property.
The bookmark of the inserted chart (example: “Sheet1![Child.xlsx]Sheet1 Chart 1”) is exposed through Shape.OleFormat.SourceItem property.
Both properties can be changed, they are read/write properties.

But, if the Excel Chart is inserted as a Graphic object, Shape.OleFormat has the null value, but I can read the link to the excel file from Shape.Chart.SourceFullName property. This property is read-only.

I have two questions for You:

  1. Can You expose the SourceItem property of the Excel Chart inserted as Graphic object, SourceItem property (example: Shape.Chart.SourceItem), as You do for charts inserted as Excel Chart Object?
  2. Can You make both properties read/write properties, existing Shape.Chart.SourceFullName and new Shape.Chart.SourceItem property?

I need the ability to manipulate the location and bookmark of the excel chart inserted as a Graphic object just as I can with a chart inserted as an Excel Chart Object.

I am sending You a test application, using Aspose.Words version 22.2.
The zip file contains AsposeWordsTest\TestFile folder.
In it is an Excel file with two charts (Child.xlsx) and a Word file (Parent.docx).
Both of the charts from Child.xlsx are inserted in Parent.docx, one as an Excel Chart Object and the other as a Graphic object.
The test application can scan links for both charts but can modify only the chart inserted as an Excel Chart object.

Here is the test application AsposeWordsTest.

Thanks in advance.

@spopov71

  1. Unfortunately it is not possible. The chart in MS Word document do not have a link to the MS Excel chart object. The chart format is stored directly in the Word document and only the links to the Excel cells range are stored in the chart series.
  2. I have created a feature request WORDSNET- 23522 for providing a setter for Shape.Chart.SourceFullName property in our defect tracking system. We will keep you informed and let you know once it is resolved.

@Konstantin.Kornilov, thank You for the quick response.
Looking forward to the successful resolution of the WORDSNET- 23522 feature request.

The issues you have found earlier (filed as WORDSNET-23522) have been fixed in this Aspose.Words for .NET 22.4 update also available on NuGet.