Vba - Log in user name

  • Thread starter Thread starter ajliaks
  • Start date Start date
A

ajliaks

Hi all,

if I use:

application.username, I get the "Computers name"

how can I get the actual logged in user in the network?
something like:
application.currentlogin ??


I also need to know if there is any posibility that more than 1 use
can input data into the same excel file on the same time?

Thanks in advance.
Aldo
 
Hi,

following code will help you.

http://www.dicks-blog.com/excel/2004/06/get_the_usernam.html


Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long

Function GetUserName() As String
Application.Volatile
Dim sBuff As String * 25
Dim lBuffLen As Long
lBuffLen = 25
apiGetUserName sBuff, lBuffLen
GetUserName = Left(sBuff, lBuffLen - 1)
End Function


--
Haldun Alay




"ajliaks >" <<[email protected]>, iletide þunu yazdý Hi all,

if I use:

application.username, I get the "Computers name"

how can I get the actual logged in user in the network?
something like:
application.currentlogin ??


I also need to know if there is any posibility that more than 1 user
can input data into the same excel file on the same time?

Thanks in advance.
Aldo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Application.UserName 2
Login Name - VBA 1
Auto_open User Name Log 2
User Name 4
Shapes in 2010 1
Getting the User Name 8
Register user on worbook open 2
Compile Error:Variable not defined 4

Back
Top