J
Julie
I have the following segment of code within a larger method that worked
just fine on Excel 97, but now on Excel 2003, I get a "run-time error
'1004' Method 'PlotBy' of '_Chart' failed" on ActiveChart.PlotBy =
xlColumns. I can comment that line out, but I am not sure if I am
affecting anything else. Does anyone know why this would no longer
work in Excel 2003?
Dim r1 As Range, r2 As Range, myMultiAreaRange As Range
Worksheets("NatureOfInjuryChart").Activate
Set r1 = Range("A5",
Worksheets("NatureOfInjuryChart").Range("A5").End(xlDown))
Set r2 = Range("C5",
Worksheets("NatureOfInjuryChart").Range("C5").End(xlDown))
Set myMultiAreaRange = Union(r1, r2)
myMultiAreaRange.Select
Range("C5").Activate
Charts.Add
ActiveChart.ChartType = xl3DPie
ActiveChart.PlotBy = xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="NatureOfInjuryChart"
#2 Also, this chart (from above) is on the same worksheet as another
chart that is using the range below (columns A & B). However the
calculations for the chart above are exactly the same as the chart
below on Excel 2003, but reflect correct percentages in Excel 97. Does
anyone know why this chart is not producing correct percentages now in
2003?
Range("A5",
Worksheets("NatureOfInjuryChart").Range("B5").End(xlDown)).Select
Range("A5").Activate
Charts.Add
ActiveChart.ChartType = xl3DPie
'ActiveChart.PlotBy = xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="NatureOfInjuryChart"
This is really stumping me. Any help is greatly appreciated.
Julie
just fine on Excel 97, but now on Excel 2003, I get a "run-time error
'1004' Method 'PlotBy' of '_Chart' failed" on ActiveChart.PlotBy =
xlColumns. I can comment that line out, but I am not sure if I am
affecting anything else. Does anyone know why this would no longer
work in Excel 2003?
Dim r1 As Range, r2 As Range, myMultiAreaRange As Range
Worksheets("NatureOfInjuryChart").Activate
Set r1 = Range("A5",
Worksheets("NatureOfInjuryChart").Range("A5").End(xlDown))
Set r2 = Range("C5",
Worksheets("NatureOfInjuryChart").Range("C5").End(xlDown))
Set myMultiAreaRange = Union(r1, r2)
myMultiAreaRange.Select
Range("C5").Activate
Charts.Add
ActiveChart.ChartType = xl3DPie
ActiveChart.PlotBy = xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="NatureOfInjuryChart"
#2 Also, this chart (from above) is on the same worksheet as another
chart that is using the range below (columns A & B). However the
calculations for the chart above are exactly the same as the chart
below on Excel 2003, but reflect correct percentages in Excel 97. Does
anyone know why this chart is not producing correct percentages now in
2003?
Range("A5",
Worksheets("NatureOfInjuryChart").Range("B5").End(xlDown)).Select
Range("A5").Activate
Charts.Add
ActiveChart.ChartType = xl3DPie
'ActiveChart.PlotBy = xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="NatureOfInjuryChart"
This is really stumping me. Any help is greatly appreciated.
Julie