How do you center align a resized PlotArea?
With objChart
.Left = myChtRange.Left
.Top = myChtRange.Top
.Width = myChtRange.Width
.Height = myChtRange.Height
With .Chart
'=====================
Dim temp As Integer
With .PlotArea
temp = .Width
temp = .Height
temp = .Left
temp = .Top
.Width = 200
.Height = 100
'.Left = 10
'.Top = 10
.Left = (objChart.Width - objChart.Chart.PlotArea.Width) / 2
.Top = (objChart.Height - objChart.Chart.PlotArea.Height) / 2
'.Position = xlChartElementPositionAutomatic
End With
'=====================
End With
End With
This does not center align the PlotArea:
With .PlotArea
.Left = (objChart.Width - objChart.Chart.PlotArea.Width) / 2
This does center align the PlotArea but also resets its size:
With .PlotArea
.Position = xlChartElementPositionAutomatic