Show UserStatus Names

Mudbutt

Board Regular
Joined
Jul 18, 2011
Messages
158
I'm trying to make this code give me a message box with the users that are in this shared file. The problem is that it will bring up the box if I'm the only person in it, and I don't care about that because the purpose is to warn me if other users are in the file before I unshare it.

Does anyone know how to adjust this code properly so that it gives the message box if more than 1 user is in it (which would be me)?

Code:
Private Sub MsgboxUsers()
    With WorksheetFunction
        MsgBox Prompt:=Join(.Transpose(.Index(Activeworkbook.UserStatus, 0, 1)), vbLf), _
               Title:="Users"
    End With
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You could use
Code:
If UBound(Activeworkbook.UserStatus, 1) > 0 then
 
Upvote 0
Works perfectly, thanks Rory. I just had to change it to > 1 instead of 0 so it ignores me in the file.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

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