I have a data tab called "Data" in my current workbook. This data comes from due to a SQL script which is connected to my database.
I would like to activate the background refresh via the code below, but I am not succeeding because of the error run time 1004 Error. Is it possible to fix the code below?
Private Sub Workbook_Open()
Sheets("Data").Select
Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub