First time here, so I hope to get my answer, I looked throughout the Google but I couldn't find the answer.
Well, I got VBA code which refresh a code in SQL on Exel.
VBA code: Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
It's asking everytime my ODBC login/password and I try to refresh manually, and I'd like to run automatically by saving those information on Excel Cells or in VBA directly (I prefer a variable that is linked in excel cells in "Validação de Dados" sheets). And after that, making it better by forcing the user to insert those information in a form (to keep better looking). But the problem is that everytime I tried to run the macro, it gets an error (something like "authenticantion failure").
- My SQL code in Excel location:
- Asking about my user and login:
- Error getting by not saving user/login:
Office version: Microsoft Office 365 Business
Thanks everyone!



UID="user";PWD="pwd"- Scott Holtzman