PDA

View Full Version : Refresh MS Query - Password Issue



Herbiec09
03-13-2018, 10:39 AM
Hi All,

I am using the following simple VBA to refresh an MS Query when opening an Excel spreadsheet (Because one of my users has a MAC so I cant use Power Query):

Option Explicit

Private Sub Workbook_Open()

ThisWorkbook.RefreshAll
End Sub



The refresh works, but requires me to enter the sql database password, however I do not want users to have to enter a password every time they open the spreadsheet. Can someone assist with a modification to the code so that it also inputs the password "query" and the runs and the user does not have to enter the password manually.

Or is there an alternative way around this? I can't use Power Query because one of the main users uses a Mac.

The spreadsheet will be housed on a shared drive.

Thank you

HerbieC

SamT
03-17-2018, 01:45 PM
Moderator Bump