I have some VBA code that opens a file.
The file itself is write-protected, so before it opens, a dialog box appears asking the user to either:
Enter the password and click OK button
Open as Read-Only
Cancel button (to cancel opening the file)
My problem is when the Cancel button is clicked, the VBA thows an error 1004 (error 1004 method open of object workbooks failed)
How can I handle / catch the case where a user clicks the Cancel button?