ExcelHobbit
New Member
- Joined
- Jan 8, 2020
- Messages
- 23
- Office Version
- 2010
- Platform
- Windows
I have a piece of VBA code that opens a workbook that is password encrypted, but could be one of three different passwords:
if it isn't the first password, i need it to try the second or third password. is there an On error method of doing this?
VBA Code:
Workbooks.Open Filename:="\\Drive1\Folder1\test.xlsx", Password:="Test1"
Workbooks.Open Filename:="\\Drive1\Folder1\test.xlsx", Password:="Test2"
Workbooks.Open Filename:="\\Drive1\Folder1\test.xlsx", Password:="Test3"
if it isn't the first password, i need it to try the second or third password. is there an On error method of doing this?