Please try this, where Table1 is your query name


Sub RefreshQuery()
    ActiveWorkbook.Connections("Query - Table1").Refresh
End Sub