R
rita
Hi everyone,
I am very new to EXCEL, please refer to the macro and help
if you can.
My question is I got an error message "unable to get the
chartobjects property of the worksheet class" at the codes
( ActiveSheet.ChartObjects("Chart 3").Activate).
This recorded macro is just select a range then make a
chart out of it. Then cut and paste the chart to another
area on the same sheet. I think the error message came
when I select and cut the graph.
I stuck at I don't know how to get the program return the
chartobject property so that I can assign the name to
chartobject.
-----------------
Range("A115").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets
("Query4").Range("A115")
ActiveChart.Location Where:=xlLocationAsObject,
Name:="Query4"
ActiveWindow.Visible = False
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
'error=> ActiveSheet.ChartObjects("Chart 3").Activate
Range("G2").Select
ActiveChart.Paste
ActiveWindow.Visible = False
Windows("macrotesting2.xls").Activate
Range("A115").Select
Selection.Cut
Range("H23").Select
ActiveSheet.Paste
Range("L24").Select
I am very new to EXCEL, please refer to the macro and help
if you can.
My question is I got an error message "unable to get the
chartobjects property of the worksheet class" at the codes
( ActiveSheet.ChartObjects("Chart 3").Activate).
This recorded macro is just select a range then make a
chart out of it. Then cut and paste the chart to another
area on the same sheet. I think the error message came
when I select and cut the graph.
I stuck at I don't know how to get the program return the
chartobject property so that I can assign the name to
chartobject.
-----------------
Range("A115").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets
("Query4").Range("A115")
ActiveChart.Location Where:=xlLocationAsObject,
Name:="Query4"
ActiveWindow.Visible = False
ActiveWindow.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized
'error=> ActiveSheet.ChartObjects("Chart 3").Activate
Range("G2").Select
ActiveChart.Paste
ActiveWindow.Visible = False
Windows("macrotesting2.xls").Activate
Range("A115").Select
Selection.Cut
Range("H23").Select
ActiveSheet.Paste
Range("L24").Select