Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 313
Default error when resizing chartarea programaticly

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.charting
external usenet poster
 
Posts: 6,582
Default error when resizing chartarea programaticly

You can't change the chart area of an embedded chart; it is defined by the
width of the chart object. Try this:

co.Width = 205

You need to make the chart object a few points wider (~ 205 I'm guessing)
than the chart area (200) of the chart it contains.

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


"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
Resizing the legend Gitche Gumee Charts and Charting in Excel 2 November 2nd 06 06:11 AM
Resizing a sheet shakey1181 Excel Discussion (Misc queries) 4 August 17th 06 05:17 PM
Resizing cells in a selection without resizing entire sheet Danielle via OfficeKB.com Excel Discussion (Misc queries) 4 August 11th 06 10:06 PM
What is the relationship between .ChartArea and the default printer ? Xavier Charts and Charting in Excel 0 May 3rd 06 02:53 PM
chartarea sandhya Charts and Charting in Excel 0 September 29th 05 01:08 PM


All times are GMT +1. The time now is 07:29 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"