I am running an Excel macro in a C# program. I have a chart and I'd like to change its properties.
Here's the code I've tried:
ActiveSheet.ChartObjects("myChart").Activate
ActiveChart.Axe(xlCategory).Select
With Selection.Format.TextFrame2.TextRange.Font 'Run-Time error: method of object failed
.BaselineOffset = 0
.Bold = msoTrue
.Size = 12
.Italic = msoFalse
End With
However using the With-EndWith statemnt is giving me a run-time error. Therefore, I'd like to know if there is any code that is equivalent to the code above. I am using Excel 2013.