Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default specifying chart size

How do you set the size of an embedded chart? I tried

sub foo()


Charts.Add

............

ActiveChart.ChartArea.Height = 200

...........

end sub

but .height is read-only. Also tried using .Shapes, but I
need the name of the shape (??) . Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default specifying chart size

Try using the ChartObject.Height property. I haven't tested it, but the help
files say...
This example sets the height of the embedded chart.

Worksheets("Sheet1").ChartObjects(1).Height = 288Hope that helps
Lin

wrote in message
...
How do you set the size of an embedded chart? I tried

sub foo()


Charts.Add

...........

ActiveChart.ChartArea.Height = 200

..........

end sub

but .height is read-only. Also tried using .Shapes, but I
need the name of the shape (??) . Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default specifying chart size

Try the following elaborated procedure.
Merry Xmas.
PB

Sub ChartSize()
'Setting the sizes of the selected chart in mm
Dim ErrMsg As String, MB As Long
'PointSize is a scale coefficient – can be adjusted
Const PointSize = 2.83, TMB = "Chart size"
On Error GoTo NoSelection
Set S = Selection.Parent
'If something other than the chart is selected
If S.Type < -4169 Then ErrMsg = "No chart": GoTo ErrExit
'Default sizes can be adjusted
ChartHeight = InputBox("Height /mm", TMB, 85)
If ChartHeight = "" Then Exit Sub
ChartWidth = InputBox("Width /mm", TMB, 100)
If ChartWidth = "" Then Exit Sub
'If the input is wrong
ErrMsg = "No correct object"
On Error GoTo ErrExit
S.Parent.Height = ChartHeight * PointSize
S.Parent.Width = ChartWidth * PointSize
On Error GoTo 0
Exit Sub
NoSelection:
ErrMsg = "No object"
ErrExit:
MB = MsgBox(ErrMsg & " was selected", vbCritical, TMB)
On Error GoTo 0
End Sub

-----Original Message-----
Try using the ChartObject.Height property. I haven't

tested it, but the help
files say...
This example sets the height of the embedded chart.

Worksheets("Sheet1").ChartObjects(1).Height = 288Hope

that helps
Lin

wrote in message
...
How do you set the size of an embedded chart? I tried

sub foo()


Charts.Add

...........

ActiveChart.ChartArea.Height = 200

..........

end sub

but .height is read-only. Also tried using .Shapes, but

I
need the name of the shape (??) . Thanks



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default specifying chart size

Alternatively, try this example on my web site, which lets you select a
range of data and a range of cells for the chart to cover:

http://www.geocities.com/jonpeltier/...tCreation.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

wrote:

How do you set the size of an embedded chart? I tried

sub foo()


Charts.Add

............

ActiveChart.ChartArea.Height = 200

...........

end sub

but .height is read-only. Also tried using .Shapes, but I
need the name of the shape (??) . Thanks


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
Chart size Intern Charts and Charting in Excel 1 April 21st 09 04:46 PM
HOW TO FIX SIZE OF CHART BOX Khoshravan Charts and Charting in Excel 0 September 4th 07 11:36 AM
Size of Chart Paula Excel Discussion (Misc queries) 1 June 25th 07 05:04 PM
Chart size [email protected] Charts and Charting in Excel 1 May 17th 07 05:15 PM
chart size zdenek Charts and Charting in Excel 0 February 9th 06 09:58 AM


All times are GMT +1. The time now is 11:23 AM.

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"