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
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

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
654
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?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,832
Messages
5,855,890
Members
431,772
Latest member
dannyboi1

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
Top