Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax to Find User's File in MultiUser App Chip Pearson Excel Programming 2 December 30th 06 04:20 PM
I cant find VLOOKUP on my French computer ? ExcelQuestion Excel Worksheet Functions 2 September 9th 06 01:52 PM
how do i find out the history i the excel on my computer? miumiu Excel Discussion (Misc queries) 0 June 13th 06 07:34 AM
I don't find the csv file in my computer renate Excel Discussion (Misc queries) 5 May 11th 06 09:37 PM
computer name find Craig Wilks[_2_] Excel Programming 4 October 6th 04 05:33 AM


All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"