The following code gets you as a graph although it might not be quite the graph that you are expecting. Adjust the Open line to the appropriate path.
Private Sub Workbook_Open()
Dim ws As Worksheet
Set ws = ThisWorkbook.ActiveSheet
Workbooks.Open "c:\energyOutput.csv"
Dim n
ThisWorkbook.Activate
For i = ActiveSheet.ChartObjects.Count To 1 Step -1
ActiveSheet.ChartObjects(i).Delete
Next i
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Workbooks("energyOutput.csv").Sheets("energyOutput").Range("$A1:$C" & Workbooks("energyOutput.csv").Sheets("energyOutput").Cells(65536, 1).End(xlUp).Row)
ActiveChart.ChartType = xlLine
End Sub
Bookmarks