Refresh MS Query

Herbiec09

Active Member
Joined
Aug 29, 2006
Messages
250
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 refressh works, but requires me to enter the password, however I d not want users to have to enter a password everytime 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

Thank you

Herbz
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Watch MrExcel Video

Forum statistics

Threads
1,102,450
Messages
5,486,971
Members
407,575
Latest member
calc

This Week's Hot Topics

Top