I have 10 Excel files that are connected to a SQL Server by OLEDB and I need to refresh them everyday one by one manually. When I refresh them I need to insert a password. I tried to make a macro to automate this process, but I didn't succeed. I did this function to automate one of my workbooks:
Sub updateABC()
Workbooks("Teste").Connections("SQL Server_Azure1").OLEDBConnection.Refresh
End Sub
And the Excel ask for the password to SQL Server logon. Is there any way to put this password automatically using vba?
Thanks.
ADOandconnection string.