Resize Chart Area in 2010 Excel VBA

rathalex

New Member
Joined
Oct 25, 2017
Messages
32
Hello

Im trying to resize the chart area width and height using vba,but keep getting “shape is locked and cannot be resized” error.
I am using basic commands such as:

With ActiveChart
.ChartArea.Height = 200
.ChartArea.Width= 50
End With

Any way to work around this lock error?

Thank you
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
HTH. Dave
'size chart
Code:
Dim CurrentChart As Chart
Set CurrentChart = Sheets("Sheet1").ChartObjects(1).Chart
CurrentChart.Parent.Width = 50
CurrentChart.Parent.Height = 200
There's a plotarea as well...
Code:
With Sheets("Sheet1").ChartObjects(1).Chart.PlotArea
.Width = 50
.Height = 200
.Top = 20  'apply plot area distance from top of chart
.Left = 15  'apply plot area distance from left of chart
End With
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,905
Members
449,478
Latest member
Davenil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top