Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
find user's computer name
Hi all, I got macro below which tell me user's computer name who is
logged on in current database. What changes I do in below macro that it should tell me the user's machine name who is logged on in the database which is on path "C:\Documents\Record.mdb". Please can any friend can help Private Declare Function apiGetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long Private Function fOSMachineName() As String 'Returns the computername Dim lngLen As Long, lngX As Long Dim strCompName As String strCompName = String$(16, 0) lngLen = 16 lngX = apiGetComputerName(strCompName, lngLen) If (lngX 0) Then fOSMachineName = Left$(strCompName, lngLen) Else fOSMachineName = vbNullString End If End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
find user's computer name
Try ComputerName = environ("ComputerName") It is one of the environmental parameters which you can see by opening a DOS window and typing SET at the prompt Start - Run type CMD.EXE at dos prompt type SET From Vista Start - Search - CMD.EXE at dos prompt type SET Each of the variables in that are returned can be obtained using the environmental command in VBA, -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160666 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Syntax to Find User's File in MultiUser App | Excel Programming | |||
I cant find VLOOKUP on my French computer ? | Excel Worksheet Functions | |||
how do i find out the history i the excel on my computer? | Excel Discussion (Misc queries) | |||
I don't find the csv file in my computer | Excel Discussion (Misc queries) | |||
computer name find | Excel Programming |