Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Shared Workbook - Want to See list of Current Users

Status
Not open for further replies.

Curtis99

Programmer
Aug 1, 2008
1
US
Hello,

I'm new to Excel VBA programming, and have much to learn. I apologize if my question is overly simple.

I have a shared workbook, and at any given time a number of people may be using it. Is there a way - using VBA - to see the names of all the users?

Thanks!

Sincerely,
Curtis
 
This should do what you need, though there may be a better way...

Code:
Sub CurUserNames()
    uSize = UBound(ThisWorkbook.UserStatus)
    For i = 1 To uSize
        MsgBox ThisWorkbook.UserStatus(i, 1)
    Next
End Sub

BD
 
Hi BD,

I find that Shared mode leaves a bunch of userstatus refs in memory from previous sessions, giving unrealistic results from the UserStatus property. Haven't worked on an alternative as yet.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
lol - the alternative is to not used the shred workbook feature of excel because it is buggy and doesn't usually work well.

Simple answer is:

Multi-user = database
single user = spreadsheet

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top