Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveChart.ADD Fails
I have recorded a macro to add a new chart sheet but when
running the macro is step mode it fails: the statements are Charts.Add ActiveChart.ChartType = xlSurface and I get Runtime error '1004' method Charttype of object _chart failed... any ideas - this is bog standard code regards Sean |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveChart.ADD Fails
Hi Sean,
The reason it fails is there is not enough data in the chart to change it to a surface chart. Try adding data to your chart before changing the chart type. Try to change the chart, that is created by the Charts.Add command, manually and you will see an explanation. Cheers Andy Sean McPoland wrote: I have recorded a macro to add a new chart sheet but when running the macro is step mode it fails: the statements are Charts.Add ActiveChart.ChartType = xlSurface and I get Runtime error '1004' method Charttype of object _chart failed... any ideas - this is bog standard code regards Sean -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveChart.ADD Fails
Hi Andy and thanks,
so what your really saying is that the Macro recorder is at fault in that is does not order the statements in the correct manner for creating a chart. ie Add chart add Series Data then change charttype..... Bujjer - who would have guessed that the macro recorder would have got it so wrong...... Thanks again, will try it out later regards Sean -----Original Message----- Hi Sean, The reason it fails is there is not enough data in the chart to change it to a surface chart. Try adding data to your chart before changing the chart type. Try to change the chart, that is created by the Charts.Add command, manually and you will see an explanation. Cheers Andy Sean McPoland wrote: I have recorded a macro to add a new chart sheet but when running the macro is step mode it fails: the statements are Charts.Add ActiveChart.ChartType = xlSurface and I get Runtime error '1004' method Charttype of object _chart failed... any ideas - this is bog standard code regards Sean -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveChart.ADD Fails
Anything that the macro recorder spits out has to be used with care. There are a few things like
this that it puts lines in the wrong order. Also remember that it records you while you do things, and working with a mouse and selecting everything before working on it is very inefficient. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Sean McPoland wrote: Hi Andy and thanks, so what your really saying is that the Macro recorder is at fault in that is does not order the statements in the correct manner for creating a chart. ie Add chart add Series Data then change charttype..... Bujjer - who would have guessed that the macro recorder would have got it so wrong...... Thanks again, will try it out later regards Sean -----Original Message----- Hi Sean, The reason it fails is there is not enough data in the chart to change it to a surface chart. Try adding data to your chart before changing the chart type. Try to change the chart, that is created by the Charts.Add command, manually and you will see an explanation. Cheers Andy Sean McPoland wrote: I have recorded a macro to add a new chart sheet but when running the macro is step mode it fails: the statements are Charts.Add ActiveChart.ChartType = xlSurface and I get Runtime error '1004' method Charttype of object _chart failed... any ideas - this is bog standard code regards Sean -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveChart.Location help | Excel Discussion (Misc queries) | |||
Activechart.SetSourceData Source??? | Excel Programming | |||
Activechart.SetSourceMethod problem | Excel Programming | |||
How does the ActiveChart.Location() work | Excel Programming | |||
Argument List Of ActiveChart.Location And ActiveChart.ChartType | Excel Programming |