here is the segment of code
With .Parent
.Top = chtLoc1.Offset(26, 0).Top
.Left = chtLoc1.Left
.Height = 252
.Width = 432
.Name = chtNm
End With
With ActiveChart.PlotArea
.Top = 20
.Height = 221
.Left = 0
.Width = 340
End With
the inconstancies occur at .plotarea.height and .width
I thing there must be another setting that is unique to the two charts
that this occurs on. the same code is cycled through to create each
chart.
Thanks
Robert
So despite defining the widths for Shape, ChartObject, ChartArea, and PlotArea as the same for two charts they can actually have different widths visually. It's infuriating and there must be some hidden variable somewhere. Any ideas...?
'Setting widths
sName = ActiveChart.Parent.Name
ActiveSheet.Shapes(sName).Width = nWidth
With ActiveChart
.Parent.Width = nWidth
.ChartArea.Width = nWidth
.PlotArea.Width = nWidth
End With
Robert H wrote:
plot area inconsistent sizes with VBA
16-Dec-08
Thanks
Robert
Previous Posts In This Thread:
On Tuesday, December 16, 2008 1:30 AM
Robert H wrote:
plot area inconsistent sizes with VBA
Thanks
Robert
Submitted via EggHeadCafe - Software Developer Portal of Choice
Win a Free License of SandRibbon for Silverlight
http://www.eggheadcafe.com/tutorials/aspnet/cb3912a1-be37-4032-a71a-598cae18c0d7/win-a-free-license-of-sandribbon-for-silverlight.aspx
The PlotArea has read-only properties .InsideLeft, .InsideTop,
.InsideWidth, and .InsideHeight, which define the dimensions of the
rectangle defined by the axes. You cannot change them directly, but you
can adjust the read/write properties .Left, .Top, .Width, and .Height in
order to fix the inside dimensions. When the configuration of axis
labels changes, you will likely need to repeat the resizing exercise.
Long ago I posted a routine within the following zip file which carries
out a resizing of chart plot area dimensions to unify the dimensions of
their plot area inside dimensions.
Align Chart Dimensions
http://peltiertech.com/Excel/Zips/AlignChartDimensions.zip
- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
774-275-0064
http://peltiertech.com/