K
Keith B
I have a worksheet with a number of embedded charts. In previous versions of
Excel within a macro I could loop through the charts that the user has
selected (either one or more) by using code of the form:
If (ActiveChart Is Nothing) Then
For Each coChartObject In Selection
coChartObject.Chart.HasTitle = True
coChartObject.Chart.ChartTitle.Text = sInputBoxResponse
Next coChartObject
Else
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = sInputBoxResponse
End If
This code no longer works in 2007. What am I doing wrong? What code in
2007 can perform similarly?
Note: If I select one chart the object type of the selection is ChartArea,
if more than one chart is selected the object type of the selection is
ChartObjects. In the case of the latter, the .Count of the ChartObjects is
NOT equal to the number of charts that are selected, however, is equal to the
number of charts in the worksheet.
Thank you
Excel within a macro I could loop through the charts that the user has
selected (either one or more) by using code of the form:
If (ActiveChart Is Nothing) Then
For Each coChartObject In Selection
coChartObject.Chart.HasTitle = True
coChartObject.Chart.ChartTitle.Text = sInputBoxResponse
Next coChartObject
Else
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = sInputBoxResponse
End If
This code no longer works in 2007. What am I doing wrong? What code in
2007 can perform similarly?
Note: If I select one chart the object type of the selection is ChartArea,
if more than one chart is selected the object type of the selection is
ChartObjects. In the case of the latter, the .Count of the ChartObjects is
NOT equal to the number of charts that are selected, however, is equal to the
number of charts in the worksheet.
Thank you