Hello

I have some data on a table("FSTHR_tests") in the worksheet ("Project Results") and want to extract some of the data to make some graphs, which will be diplayed in UserForm1. Below is my attempt to the code. I get the error: 'Method 'Values" of object "Series" failed. Any assistance would be greatly appreciated!

Private Sub cmdLoad_Click()
If ComboBox1.Text = "Select Chart" Then


MsgBox "Select a chart from the dropdown list"
Exit Sub


Dim MyChart As Chart
Dim ChartData As Range
Dim chartIndex As Integer
Dim ChartName As String


chartIndex = ComboBox4.ListIndex


Select Case chartIndex


Case 0
Set ChartData = Worksheets("Project Results").ListObjects("FSTHR_tests").ListColumns("Avg-Burn Time (s)").DataBodyRange
ChartName = Avg_Burn_Time
End Select
End If
Application.ScreenUpdating = False


Set MyChart = Worksheets("Project Results").Shapes.AddChart(xlXYScatterLines).Chart
MyChart.SeriesCollection.NewSeries
MyChart.SeriesCollection(1).Name = ChartName
MyChart.SeriesCollection(1).values = ChartData
MyChart.SeriesCollection(1).XValues = Worksheets("Project Results").ListObjects("FSTHR_tests").ListColumns("#")


Dim imageName As String
imageName = Application.DefaultFilePath & Application.PathSeparator & "TempChart.gif"
MsgBox "The default file path is " & Application.DefaultFilePath
MyChart.Export Filename:=imageName, FilterName:="GIF"


Worksheets("Project Results").ChartObjects(1).Delete


Application.ScreenUpdating = True


UserForm1.Image1.Picture = LoadPicture(imageName)
Please note that the case is not done yet. There will be many more graphs to follow. I only want to get my code working for one graph.
Further, The error is on the line
 MyChart.SeriesCollection(1).values = ChartData