Find person blocking a document

metropol

Board Regular
Joined
Aug 19, 2005
Messages
209
Hi.

I wonder if there is possible to find the username that is blocking a document from beeing opened in write mode, using vba code.

I have a macro that opens a document for updating some information fields. This is not possible if another person is using the same document. I can not use "shared" function on the document since this is not an option for the sheet.

I can see that a dialog box appears telling me that user xxxyyy is using the document and that it is opened in protection mode. But I can't find the correct code for this.

Thanks.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

I have no problem finding out if the file is read-only (used by another person), the challenge is to extract the username of the other person. When i try "username" in the code, it is my username and not the other guy.

My initial thought was that this is a windows message, and not an excel messag
 
Upvote 0

Forum statistics

Threads
1,202,908
Messages
6,052,488
Members
444,587
Latest member
ezza59

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top