Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Embedded Excel 2003 spreadsheet in web page won't work with Excel 2007 | Excel Discussion (Misc queries) | |||
Data Import to Excel Issue with Excel 2007 and Excel 2003 on same | Excel Discussion (Misc queries) | |||
Excel 2007 xlsx files open as Read-Only in Excel 2003 after Compat | Excel Discussion (Misc queries) | |||
Excel 2007 unrecognized file format in Excel 2003 More options | Excel Discussion (Misc queries) | |||
Inexact? InsideTop and InsideLeft Method of PlotArea (Excel 97) | Charts and Charting in Excel |