We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cannot access Chart Textboxes in aspose.cells

I have a template Excel spreadsheet which has 2 charts in it. I didn't design these charts its just my job to populate them with the correct data, and the person who designed the second chart put textboxes as labels within the chart area.

Using aspose I can populate the chart with data perfectly, however I need to be able to access these textboxes as the reports can be run in multiple languages, and so I need to update the textbox text to display the correct message for the selected language.

I've looked through the API and the developers guide but cannot find how to do this, am I missing something here? This is what I have so far:

Aspose.Cells.Workbook templateWorkbook = new Workbook();
Worksheet currentYearReportSheet = templateWorkbook.Worksheets["Report"];

//do data processing here and set NSeries data

I would like to be able to so something like:

currentYearReportSheet.Charts[1].TextBoxes.SetValue("Some Text")

Any Help would be great,



Thanks for considering Aspose.

Yes, you may do it, you can get the textbox object in the designer chart of the template excel file.

I have a chart in my sample template file and I have a textbox in this chart. I get the textbox object in the chart, change the text value and save the excel file. Following is my sample code which works fine here.

//Create a new Workbook.
Workbook workbook = new Workbook();
//Open the existing file.
//Get the designer chart in the second sheet.
Worksheet sheet = workbook.Worksheets[1];
//Get the chart.
Chart chart = sheet.Charts[0];
//Get the textbox of the chart.
Aspose.Cells.TextBox textbox0 = (Aspose.Cells.TextBox)chart.Shapes[0];
//Change the text value.
textbox0.Text = "My new value";
//Save the excel file.

Thank you


I've tried to use your code but the Chart object does not have a Shape property. I am using Aspose.Cells version, has this been introduced in a future release of Aspose.Cells?


Thanks for considering Aspose.

No, these APIs are not available in I think you should try or greater versions.

Thank you.