Suppose a workbook exists on a shared network drive, and is open by User A. If User B attempts to open this file by double clicking it, he gets something like the following prompt:
If User B instead attempts to open the workbook programmatically (perhaps with an add-in) using:
Workbooks.Open("N:\path_to_workbook\workbook.xlsx")
what happens, exactly? Does this above prompt appear? If so, can it be suppressed with Application.DisplayAlerts = False
? If Workbooks.Open
as shown above throws an exception in this case, do we need to try again using the ReadOnly argument, as:
Workbooks.Open("N:\path_to_workbook\workbook.xlsx", ReadOnly:=True)
I have read other posts (including this one) that suggest that Workbooks.Open
in the first code snippet succeeds and the workbook is opened read-only, although this is not perfectly clear.
Unfortunately, I don't have a test environment configured to replicate this scenario myself, which would otherwise be the obvious answer.