excel change diagram characteristics with VBA

72 views Asked by At

I have many diagrams in excel and I need to change their look. I wrote this cscript in VBA but it is not working:

Sub Makro1()
'
' Makro1 Makro
'

'
For i = 1 To 28
    ActiveSheet.ChartObjects("Diagramm " & i).Activate
    ActiveSheet.Shapes("Diagramm " & i).Line.Visible = msoFalse
Next i
End Sub

With this script I am trying to change the frame line to no frame line. But it is not working and I cannto find the bug. Moreover, I need to change the name of the y-axis. Any idea how can I do this?

1

There are 1 answers

0
Tim Edwards On

Not sure what you mean by frame line, your code as-is works for me by removing the object border.

Y-axis is:

ActiveChart.Axes(xlValue, xlPrimary).HasTitle = True
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Title Here"