Get the name of the person using the file


I am having a file which is in the shared folder and can be accessible by the multiple users.
When the bot is executing and it wants to access that file it will through an exception stating “The file is being used by another user.”’

So, here in the catch block, I want to know the name of the person who is using that file.

Thank in Advance!

Not sure if this will help but,

That is a vba code and can be only used for Excel. What if my file not Excel? It can be any file.