I have problem resizing plot area in an embedded chart in excel
Dim myChart As Chart
maxPie = ThisWorkbook.Sheets(sheetName).Range("A1048576").End(xlUp).Row
Set myChart = ThisWorkbook.Sheets(sheetName).Shapes.AddChart.Chart
myChart.ChartType = xlBarClustered
myChart.SetSourceData Source:=Range(sheetName & "!$A$5:$C$" & maxPie)
With myChart.Parent
.Top = 10
.Left = 500
.Width = 500
.Height = 500
End With
With myChart.PlotArea
.Top = 70
.Height = 420
End With
if i press debug and then F5 then it resizes it, do I need to add a delay in my code because its not finished generating the plot area before I try to resize it
DoEventscall, or reading the.Topvalue into a variable first can help.