![]() |
Chart "Automation"
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 |
Chart "Automation"
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 Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Bob barnes wrote: 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 |
Chart "Automation"
Jon - You gave me the answer I needed.
Thank you very much. Bob -----Original Message----- 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 Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Bob barnes wrote: 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 . |
Chart "Automation"
Bob -
Glad to help. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Bob barnes wrote: Jon - You gave me the answer I needed. Thank you very much. Bob -----Original Message----- 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 Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Bob barnes wrote: 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 . |
All times are GMT +1. The time now is 04:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com