ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   PlotArea is different between Excel 2003 and Excel 2007 (https://www.excelbanter.com/charts-charting-excel/166803-plotarea-different-between-excel-2003-excel-2007-a.html)

bill

PlotArea is different between Excel 2003 and Excel 2007
 
All,

I am having difficulty programmatically changing chart parameters. For
instance, I want to modify the PlotArea.Height of one of my charts.
When I resize it manually (i.e. increase the PlotArea by a factor of
three) everything scales just fine. When I try to set <chart.PlotArea
in VB I get an error message:

Number: 1004
Description: Chart Layout Failed

Any thoughts?

Bill

Andy Pope

PlotArea is different between Excel 2003 and Excel 2007
 
Hi,

Is that VB or did you really mean VBA?
And can you post the code you are using.


Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"bill" wrote in message
...
All,

I am having difficulty programmatically changing chart parameters. For
instance, I want to modify the PlotArea.Height of one of my charts.
When I resize it manually (i.e. increase the PlotArea by a factor of
three) everything scales just fine. When I try to set <chart.PlotArea
in VB I get an error message:

Number: 1004
Description: Chart Layout Failed

Any thoughts?

Bill



bill

PlotArea is different between Excel 2003 and Excel 2007
 
On Nov 20, 11:59 am, "Andy Pope" wrote:
Hi,

Is that VB or did you really mean VBA?
And can you post the code you are using.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"bill" wrote in message

...



All,


I am having difficulty programmatically changing chart parameters. For
instance, I want to modify the PlotArea.Height of one of my charts.
When I resize it manually (i.e. increase the PlotArea by a factor of
three) everything scales just fine. When I try to set <chart.PlotArea
in VB I get an error message:


Number: 1004
Description: Chart Layout Failed


Any thoughts?


Bill- Hide quoted text -


- Show quoted text -


Hi Andy,

VBA. Here is some of the code. The stuff in between is too ugly to
post. Basically, the chart is created, populated, and that is it:

......

Set zNewChart = zNewBook.Charts.Add(After:=zNewBook.Sheets(nChartC tr))

.....
add data series
label axes
fill in title
... bunch of other stuff .....


zNewChart.PlotArea.Height = zNewChart.PlotArea.Height - 20 ' this is
the spot where the error message occurs


The other anomaly is that if I put a breakpoint on the above, and then
continue, it does not generate an error. However, the PlotArea.Height
does not really change. Also, when I look at the Height before trying
to change it, it has a value of 473.xxxx. However, when I open the
spreadsheet and check it out, it is clearly not 473 in Height because
the DataTable is taking up around 4/5 of the chart area. In addition
to all of this, if I change Height immediately after instantiating the
chart, then there is no error message. However, the final Height of
the PlotArea is still entirely different than 453 (i.e. it is much
smaller).

Hope that wasn't too confusing,

Bill

Andy Pope

PlotArea is different between Excel 2003 and Excel 2007
 
Hi Bill,

It wasn't confusing ;)
But I am unable to replicate your error. For me adjusting the height of
the plotarea works.

The new chart OM is a little flakey. So you may have some luck by simply
messing with properties in order to get the chart to refresh itself.

If you want you can email me the file offline and I will take a look.

Cheers
Andy

bill wrote:
On Nov 20, 11:59 am, "Andy Pope" wrote:

Hi,

Is that VB or did you really mean VBA?
And can you post the code you are using.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"bill" wrote in message

...




All,


I am having difficulty programmatically changing chart parameters. For
instance, I want to modify the PlotArea.Height of one of my charts.
When I resize it manually (i.e. increase the PlotArea by a factor of
three) everything scales just fine. When I try to set <chart.PlotArea
in VB I get an error message:


Number: 1004
Description: Chart Layout Failed


Any thoughts?


Bill- Hide quoted text -


- Show quoted text -



Hi Andy,

VBA. Here is some of the code. The stuff in between is too ugly to
post. Basically, the chart is created, populated, and that is it:

.....

Set zNewChart = zNewBook.Charts.Add(After:=zNewBook.Sheets(nChartC tr))

....
add data series
label axes
fill in title
... bunch of other stuff .....


zNewChart.PlotArea.Height = zNewChart.PlotArea.Height - 20 ' this is
the spot where the error message occurs


The other anomaly is that if I put a breakpoint on the above, and then
continue, it does not generate an error. However, the PlotArea.Height
does not really change. Also, when I look at the Height before trying
to change it, it has a value of 473.xxxx. However, when I open the
spreadsheet and check it out, it is clearly not 473 in Height because
the DataTable is taking up around 4/5 of the chart area. In addition
to all of this, if I change Height immediately after instantiating the
chart, then there is no error message. However, the final Height of
the PlotArea is still entirely different than 453 (i.e. it is much
smaller).

Hope that wasn't too confusing,

Bill


Jon Peltier

PlotArea is different between Excel 2003 and Excel 2007
 
There occasionally seem to be problems in 2007 with charts that were created
in an earlier version of Excel.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Andy Pope" wrote in message
...
Hi Bill,

It wasn't confusing ;)
But I am unable to replicate your error. For me adjusting the height of
the plotarea works.

The new chart OM is a little flakey. So you may have some luck by simply
messing with properties in order to get the chart to refresh itself.

If you want you can email me the file offline and I will take a look.

Cheers
Andy

bill wrote:
On Nov 20, 11:59 am, "Andy Pope" wrote:

Hi,

Is that VB or did you really mean VBA?
And can you post the code you are using.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"bill"
wrote in message

...




All,

I am having difficulty programmatically changing chart parameters. For
instance, I want to modify the PlotArea.Height of one of my charts.
When I resize it manually (i.e. increase the PlotArea by a factor of
three) everything scales just fine. When I try to set <chart.PlotArea
in VB I get an error message:

Number: 1004
Description: Chart Layout Failed

Any thoughts?

Bill- Hide quoted text -

- Show quoted text -



Hi Andy,

VBA. Here is some of the code. The stuff in between is too ugly to
post. Basically, the chart is created, populated, and that is it:

.....

Set zNewChart = zNewBook.Charts.Add(After:=zNewBook.Sheets(nChartC tr))

....
add data series
label axes
fill in title
... bunch of other stuff .....


zNewChart.PlotArea.Height = zNewChart.PlotArea.Height - 20 ' this is
the spot where the error message occurs


The other anomaly is that if I put a breakpoint on the above, and then
continue, it does not generate an error. However, the PlotArea.Height
does not really change. Also, when I look at the Height before trying
to change it, it has a value of 473.xxxx. However, when I open the
spreadsheet and check it out, it is clearly not 473 in Height because
the DataTable is taking up around 4/5 of the chart area. In addition
to all of this, if I change Height immediately after instantiating the
chart, then there is no error message. However, the final Height of
the PlotArea is still entirely different than 453 (i.e. it is much
smaller).

Hope that wasn't too confusing,

Bill




bill

PlotArea is different between Excel 2003 and Excel 2007
 
On Nov 20, 4:08 pm, "Jon Peltier"
wrote:
There occasionally seem to be problems in 2007 with charts that were created
in an earlier version of Excel.

- Jon


Except that I am creating then from scratch in 2007.

Bill


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com