I’m trying to change the value of a single bar chart via VBA, unsuccessfully.
I can read the value but, cannot change it.
Private Sub btnTeste3_Click()
Dim sld As Slide
Dim shp As Shape
Dim ch As Chart
Dim srs As Series
Set sld = ActivePresentation.Slides(2)
Set shp = sld.Shapes("Barra 1")
Set ch = shp.Chart
Set srs = ch.SeriesCollection(1)
MsgBox "Nome da Forma: " & sld.Shapes("Barra 1").Name & vbNewLine & _
"Valor: " & srs.Values(1)
'None of them works but, it doesn't raise any error.
srs.Values(1) = 30
srs.Values(1) = CDbl(30)
srs.Values(1) = Array(CDbl(30))
Set sld = Nothing
Set shp = Nothing
Set ch = Nothing
Set srs = Nothing
End Sub
if anyone knows, please, help me.
thanks in advance.