There are lot of similar questions but not exactly what I am looking for.
I am using Excel Interop
in C#
for working with excel files. I want to specifically know whether Excel Interop's Workbooks.Open()
method can detect if the file is already open. Are there any parameters that we can set so that the Workbooks.Open()
method raises exception if file was already open by some other user. Currently, it doesn't seem to raise any exception if the file is in use by other user.
Please scope the answers to whether this is possible using Workbooks.Open()
. There are already answers on stackoverflow related to using System.IO.File
for this purpose.