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

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
 
L

Leith Ross

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top