I am a new member to the forum. I've looked through the various threads, but can't find a solution to my current problem. I have a query in one workbook that updates from a table in another password protected workbook. A password is required both to open and modify the workbook. I need VBA code to open the password protected workbook, update the query, and then close the workbook, after the query has refreshed.
I have got as far as opening the workbook and refreshing the query. The two areas I need help with are:
1. what is the code to get past the modify password?
2. what is the code to close the workbook only after the query has refreshed? (I can close the workbook, but it does it before the refresh is complete and the refresh therefore fails)
Obviously I have access to all passwords.
Code extract
[I]
Bookmarks