Hello,

This is my code:
Sub TEST()

' Keyboard Shortcut: Ctrl+q

    ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
    ActiveChart.ApplyChartTemplate ( _
        "C:\Users\joachim\AppData\Roaming\Microsoft\Templates\Charts\ABC Column.crtx")
    ActiveChart.SetSourceData Source:=Range("ActiveCells").Select

End Sub
It creates the correct chart but gives me the 1004 error and says "The Specified Dimension is not valid for the current chart type.". How come the code works but still gives me that error? I know it has something to do with the Range variable. Is there something else I should write instead of "ActiveCells"? What I want it to do is to create the chart when I press ctrl+Q from the cells that I've selected


Thanks in advance,
Joachim