I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code:
On Error Resume Next
Workbook
For the record - the reason was indeed the structure protection of the workbook I was opening. I could circumvent the problem by disabling structure protection, and re-protecting in Workbook_Open() (in the protected workbook).
With structure protection inactive, Workbooks.Open with password does not fail even when there is no password.
Since I am opening via a VBA method, the VBA code is already trusted, meaning the Workbook_Open method will surely be called.