Chart "Automation"

  • Thread starter Thread starter Bob barnes
  • Start date Start date
B

Bob barnes

I am an Access developer using Automation to move data
from Access to Excel.

I went to the Excel Project Explorer to see how Chart
Objects might be named. All I saw were Sheets. I would
like to see if I can assign a Chart Title variable Dates
(via VBA) to a Chart.

Can this be done?

TIA - Bob
 
Bob -

Charts on their own sheet (chart sheets) show up in the project
explorer, but charts embedded in a worksheet don't show up.

If you mean the Chart Title text element in a chart, you get to it like
this:

' chart sheet named "My Chart"
With ActiveWorkbook.Charts("My Chart")
.HasTitle = True
.ChartTitle.Text = "My New Title"
End With

' embedded chart object in sheet "My Sheet"
' pick the appropriate index for ChartObjects(i)
With ActiveWorkbook.Worksheets("My Sheet").ChartObjects(1).Chart
.HasTitle = True
.ChartTitle.Text = "My New Title"
End With

- Jon
 
Jon - You gave me the answer I needed.

Thank you very much. Bob

-----Original Message-----
 
Back
Top