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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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