Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveChart.Location help Dave Excel Discussion (Misc queries) 1 November 16th 07 07:38 PM
Activechart.SetSourceData Source??? Bob R Excel Programming 2 July 30th 04 03:39 PM
Activechart.SetSourceMethod problem grinning_crow Excel Programming 2 March 1st 04 10:07 PM
How does the ActiveChart.Location() work Ramil[_2_] Excel Programming 0 January 20th 04 04:56 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo[_3_] Excel Programming 2 September 1st 03 11:12 PM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"