Re: Identifying the username that is locking a file for editing
Thank you all for your replies. I've written time out code for wookbooks before. I also know how to retrieve the windows username in code. However I don't want to rely on code in the workbook being locked. The workbook is viewed by a large audience many of which don't enable macros. I know I can write code to "force" them to do so by hiding sheets etc etc.. Been there done that.
I want the workbook that is being locked for editing to be void of macros. Just a plain old everyday spreadsheet with no VBA.
What I would really like to do is write some code that I could put into a workbook that would prompt the user for the location of the file in question using the 'GetOpenFileName' method. Allow the user to point to any MS Spreadsheet. Then if the spreadsheet is locked for editing, display the windows user ID of the user who is locking it. If it is not locked for editing display a message stating so.
I don't know where to start writing code that can read the userID remotely like this.