ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vba - Log in user name (https://www.excelbanter.com/excel-programming/309178-vba-log-user-name.html)

ajliaks[_37_]

Vba - Log in user name
 
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

--
Message posted from http://www.ExcelForum.com


Haldun Alay[_3_]

Vba - Log in user name
 

Hi,

following code will help you.

http://www.dicks-blog.com/excel/2004...e_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 " , 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.


---
Message posted from http://www.ExcelForum.com/


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com