Hi
Charts are contained inside ChartObjects. Chartobjects have names
(which you don't see on the "chart") while Charts have titles (which
you do see).
If you only have one chart on a sheet then it is contained inside one
ChartObject and you can do
myName = ActiveSheet.ChartObject(1).Name
myTitle = ActiveSheet.ChartObject(1).Chart.Title
to get name and title.
To see if a chart exists try
On Error resume next
Set myChartObject = Activesheet.ChartObjects(myName)
If myChartObject is Nothing then
If ActiveSheet.ChartObjects.Count > 0 Then
MsgBox "has some!"
Else
MsgBox "nope"
End If
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.