The below code successfully creates and formats the chart how I want it, but it is not being positioned correctly. The top position of the chart is not where I want it. If I tell the code to put the top of the chart at A200, the top of the chart is closer to A203. If I tell the code to put the top of the chart at A50, the top of the chart is closer to A51. Any idea what's going on here?
Code:
Set fversustrange = Union(timedata, forcedata)
Dim fversustchartdest As String
fversustchartdest = "A50"
Set fversustchart = Worksheets("CompositeBeamOutputFiles").Shapes.AddChart2( _
Style:=-1, _
XlChartType:=xlXYScatterLinesNoMarkers, _
Left:=Worksheets("CompositeBeamOutputfiles").Range(fversustchartdest).Left, _
Top:=Worksheets("CompositeBeamOutputfiles").Range(fversustchartdest).Top, _
Width:=230, _
Height:=200, _
NewLayout:=True).Chart
With fversustchart
.SetSourceData Source:=fversustrange
.ChartTitle.Text = "Applied Force (lbf) Versus Time (ms)"
.ChartTitle.Font.Size = 10
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Underline = True
.Axes(xlCategory).MaximumScale = Round(WorksheetFunction.Max(tdata), 0)
End With