How to link a chart title to a worksheet cell c#?

  • Thread starter Thread starter Frank M. Walter
  • Start date Start date
F

Frank M. Walter

Hello,

it is possible to link a chart title to a cell via vba macro:

Sub Makro2()
ActiveSheet.ChartObjects("Diagramm 1").Activate
ActiveChart.ChartTitle.Select
Selection.Text = "=Tabelle1!R1C3"
End Sub

How do I do this in c#?

Just puting this code
string newTitle = "=Tabelle1!R1C3"

chart.ChartTitle.Text = newTitle.ToString() ;

....gets only the content of existing cell and puts ot to chart title.

The formula is not getting.



Thanks
Frank
 
Hello Frank,

Change your code to the following...

Sub Makro2()
ActiveSheet.ChartObjects("Diagramm 1").Activate
ActiveChart.ChartTitle.Text = Evaluate("=Tabelle1!R1C3")
End Sub

Sincerely,
Leith Ros
 
Back
Top