Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart size | Charts and Charting in Excel | |||
HOW TO FIX SIZE OF CHART BOX | Charts and Charting in Excel | |||
Size of Chart | Excel Discussion (Misc queries) | |||
Chart size | Charts and Charting in Excel | |||
chart size | Charts and Charting in Excel |