Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 313
Default error in setting chart area width

sThis snipet of code fails in the with black while trying to set .width = 200

sub a()
Set co = ActiveSheet.ChartObjects.Add(cw * 3, rh * 0.5, cw * 8, rh * 20)
' Name it
co.Name = "ChartExample"

With co.Chart.ChartArea
.Width = 200
End With

end sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default error in setting chart area width

I couldn't get it to work either. It gives me an error for both width and
height as unable to set for ChartArea class. It did work for setting the
pattern for the chart area, so I'm thinking that this is a Microsoft SNAFU.

"TONY" wrote:

sThis snipet of code fails in the with black while trying to set .width = 200

sub a()
Set co = ActiveSheet.ChartObjects.Add(cw * 3, rh * 0.5, cw * 8, rh * 20)
' Name it
co.Name = "ChartExample"

With co.Chart.ChartArea
.Width = 200
End With

end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default error in setting chart area width

The chartarea's width & height properties are read only, determined by the
chartobject's size, just a couple of pixels or so inside allowing for the
border. So to change the chartarea's size re-size the chartobject. You can
re-size the PlotArea though the chart would need at least one series.

In passing, in a chart-sheet the chartarea's size is determined by the
sheet's PageSetup settings.

Regards,
Peter T

"TONY" wrote in message
...
sThis snipet of code fails in the with black while trying to set .width =

200

sub a()
Set co = ActiveSheet.ChartObjects.Add(cw * 3, rh * 0.5, cw * 8, rh * 20)
' Name it
co.Name = "ChartExample"

With co.Chart.ChartArea
.Width = 200
End With

end sub



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
setting chart length & width in centimeters Freddy[_3_] Charts and Charting in Excel 2 November 27th 08 01:51 AM
error when setting XValues for chart [email protected] Excel Programming 1 May 8th 06 05:06 AM
Error when setting chart Axis value Job Excel Programming 1 May 6th 05 04:04 PM
setting the radius / area of a pie chart? anson Charts and Charting in Excel 0 February 20th 05 04:41 PM
Setting custom chart causes plot area to collapse Chiara Charts and Charting in Excel 0 January 20th 05 05:32 PM


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

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

About Us

"It's about Microsoft Excel"