Locking an excel file for updating records

If I use Excel Application Scopen, does that mean I could read the file, update the table, write back the file all the while the file is locked.

I have three processes that can read/write to the same excel file so I need a way to lock the file while updating.

@bcm Excel application scope locks the file from its own. No one else can edit/update if it has already opened by 1 process

Actually, It does not seem to lock the file.

I have a workflow where with an Excel Applicaion Scope. There was no exception thrown when I try to open an excel file that I had already opened in Excel. This workflow opens the file (despite already being opened) and does a readrange, adds a new datarow and writerange.

What gives?

Is there another way to lock a file?

Main.xaml (14.0 KB)

@bcm If someone else try to open a file then it will throw a popup like this. I just captured this screenshot for you!
This popup means that, Excel Application Scope locked that file.
you can check the same by having a message box inside Excel application scope and open the same file manulally

Wow, I don’t get any messages. I even tried to put my application scope inside another scope and open the same file, no problem, no exceptions.

I think I need a solution that reliable and consistent.

I hate wasting time on things like this.