ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Excel Chart Size (https://www.excelbanter.com/excel-programming/274493-re-changing-excel-chart-size.html)

keepITcool

Changing Excel Chart Size
 
the moment you insert it.. it becomes a shape object
For a shape you can set shape.width/.height or use scaling.

try the macro recorder and see what it records.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Marcy" wrote:

I am using VB to create a chart in excel and paste it into
the VB application. The chart is coming in a little bit
smaller than I would like and I am wondering if there is a
way to resize the entire chart object using VB. I tried
the ChartArea property, but it is Read-Only for a Chart
object. Any suggestions?

Thanks!



Jon Peltier[_3_]

Changing Excel Chart Size
 
Or resize the chart object, which is the chart.parent object.

with MyChart.Parent
.Height = 1.2 * .Height
.Width = 1.2 * Width
End With

I prefer to do as much reformatting & resizing on the actual chart, and
minimize adjustments to the resulting shape in the other application.

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

keepitcool wrote:
the moment you insert it.. it becomes a shape object
For a shape you can set shape.width/.height or use scaling.

try the macro recorder and see what it records.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Marcy" wrote:


I am using VB to create a chart in excel and paste it into
the VB application. The chart is coming in a little bit
smaller than I would like and I am wondering if there is a
way to resize the entire chart object using VB. I tried
the ChartArea property, but it is Read-Only for a Chart
object. Any suggestions?

Thanks!





keepITcool

Changing Excel Chart Size
 
ok. i agree.

for clarification to OP:

the hierarchy is as follows:

worksheet(1).shapes(1).drawingobject = chartObject
chart.parent = shape.drawingobject = chartObject


TIP & illustration:

'make sure the LOCALS pane in VBE is visible! (/View/Locals window)
'honestly you cant do without this window if you're debugging
'you can replace the stop statement with a breakpoint (F9) on the line
below

sub checkme()
dim x
set x=activesheet.shapes(1)
stop
end sub
'now have a look at the locals window....
'and click the treeview in it to see all applicable properties.
'from your variables.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


Jon Peltier wrote:

Or resize the chart object, which is the chart.parent object.

with MyChart.Parent
.Height = 1.2 * .Height
.Width = 1.2 * Width
End With

I prefer to do as much reformatting & resizing on the actual chart,
and minimize adjustments to the resulting shape in the other
application.

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

keepitcool wrote:
the moment you insert it.. it becomes a shape object
For a shape you can set shape.width/.height or use scaling.

try the macro recorder and see what it records.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Marcy" wrote:


I am using VB to create a chart in excel and paste it into
the VB application. The chart is coming in a little bit
smaller than I would like and I am wondering if there is a
way to resize the entire chart object using VB. I tried
the ChartArea property, but it is Read-Only for a Chart
object. Any suggestions?

Thanks!







All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com