P
Phil Hageman
The following sub is suppose to make a list of all charts
in a worksheet. When running the sub, I get Run-time
error '1004': Unable to get the Caption property of the
ChartTitle class. The line Msg = Msg & vbCrLf... is
highlighted. Can someone help me fix this.
Sub ListCharts()
Dim Msg As String
Dim ChtOb As ChartObject
Msg = ActiveSheet.Name & vbCrLf
For Each ChtOb In ActiveSheet.ChartObjects
Msg = Msg & vbCrLf & ChtOb.Name & " : " &
ChtOb.Chart.ChartTitle.Caption
Next
MsgBox Msg
End Sub
in a worksheet. When running the sub, I get Run-time
error '1004': Unable to get the Caption property of the
ChartTitle class. The line Msg = Msg & vbCrLf... is
highlighted. Can someone help me fix this.
Sub ListCharts()
Dim Msg As String
Dim ChtOb As ChartObject
Msg = ActiveSheet.Name & vbCrLf
For Each ChtOb In ActiveSheet.ChartObjects
Msg = Msg & vbCrLf & ChtOb.Name & " : " &
ChtOb.Chart.ChartTitle.Caption
Next
MsgBox Msg
End Sub