Refresh Excel QueryTable using VBA
I'm trying to refresh an existing query in a hidden sheet and keep that sheet hidden. The query uses an ODBC connection to an SQL database. The problem is that the SWL server requests the userid and password before completing the refresh. How can I clean this up and automatically feed ther connection srtring?
Private Sub update_inventory_Click()
Sheets("Invent").Visible = True
Sheets("Invent").Visible = False