I have a model I need to amend that opens workbooks and summarises data from a number of workbooks into it.
The workbooks are password protected and a change of passwords has meant a number of possible passwords are correct for any workbook so I need a way of cycling through to see which works and then open the workbook so it can be used by the model.
To open each workbook the model uses the following code:
Workbooks.Open Finename:=file.Path, Update Links:=0, ReadOnly:=True Password:=strPassword (variable that picks password from sheet)
Could you please help with how code could loop through atleast 4 passwords and open using the correct password?
Thanks for your help in advance
The workbooks are password protected and a change of passwords has meant a number of possible passwords are correct for any workbook so I need a way of cycling through to see which works and then open the workbook so it can be used by the model.
To open each workbook the model uses the following code:
Workbooks.Open Finename:=file.Path, Update Links:=0, ReadOnly:=True Password:=strPassword (variable that picks password from sheet)
Could you please help with how code could loop through atleast 4 passwords and open using the correct password?
Thanks for your help in advance
Last edited: