Who has my Excel Workbook open from VB

rmedway

New Member
Joined
Nov 17, 2005
Messages
1
If my spreadsheet is in use by another user and I try to open it manually, Excel pops up a "File in use" dialogue box and nicely tells me that "MyWoorbook.xls" is locked for editing by "UserName". Therefore Excel has the ability to know who has the file open. How can my VB code do the same thing? I need to find the username so that after say, 20 mins, I can send the user a polite email reminding them to exit after use.

Any help would be much appreciated.
Thanks
RUssell
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

jdc

Active Member
Joined
Nov 23, 2004
Messages
263
Hi

The reason it comes up with "Username" is because whoever has the file open has not customised the office or excel program on this particular pc to give a proper name in the Tools, Options, General, User name box

It usually comes up as Network Admin on the one here where I work which is much use either.

HTH

John
 

StuLux

Well-known Member
Joined
Sep 14, 2005
Messages
642
Office Version
  1. 365
Platform
  1. Windows
I have exactly the same problem (default user name in this organisation is "Any authorised employee" !!!).

However all users have a unique logon to the system is there anyway of establishing this using code or other software?
 

Watch MrExcel Video

Forum statistics

Threads
1,118,820
Messages
5,574,508
Members
412,599
Latest member
Schu94
Top