Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Identify computer Login ID

I am looking for a way to have Excel identify and record the ID used to log
onto the computer as a way of identifying who has accessed/opened the Excel
file. So if I open the Excel file, I want the workbook to record my computer
Login ID on a sheet in cell A1. Then if my coworker opens the file I want
their ID to be recorded under mine in cell A2, the next coworker in cell A3
and so forth.
I found a way to do this operation in Access but now I need the same thing
in Excel.

Any help is greatly appreciated!
Stephen W
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Identify computer Login ID

Try this

Sub test()
Dim myUserName As String
Dim objNetwork As Object
Set objNetwork = CreateObject("Wscript.network")
myUserName = objNetwork.UserName
Debug.Print myUserName
End Sub

There may be another way, but it works

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"SJW_OST" wrote:

I am looking for a way to have Excel identify and record the ID used to log
onto the computer as a way of identifying who has accessed/opened the Excel
file. So if I open the Excel file, I want the workbook to record my computer
Login ID on a sheet in cell A1. Then if my coworker opens the file I want
their ID to be recorded under mine in cell A2, the next coworker in cell A3
and so forth.
I found a way to do this operation in Access but now I need the same thing
in Excel.

Any help is greatly appreciated!
Stephen W

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Identify computer Login ID

Your code works great.
I found this code that works as well.

Sub CaptureUserID()
'2 cells must be filled in for this. Enter a character in cell A1 & A2.

Dim rng As Range

Set rng = Sheets("Sheet3").Range("A1").End(xlDown).Offset(1, 0)

rng.Value = Now()
rng.Offset(0, 1) = Application.UserName
ActiveWorkbook.Save
End Sub

Thanks for all of your help!
Stephen W

"Barb Reinhardt" wrote:

Try this

Sub test()
Dim myUserName As String
Dim objNetwork As Object
Set objNetwork = CreateObject("Wscript.network")
myUserName = objNetwork.UserName
Debug.Print myUserName
End Sub

There may be another way, but it works

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"SJW_OST" wrote:

I am looking for a way to have Excel identify and record the ID used to log
onto the computer as a way of identifying who has accessed/opened the Excel
file. So if I open the Excel file, I want the workbook to record my computer
Login ID on a sheet in cell A1. Then if my coworker opens the file I want
their ID to be recorded under mine in cell A2, the next coworker in cell A3
and so forth.
I found a way to do this operation in Access but now I need the same thing
in Excel.

Any help is greatly appreciated!
Stephen W

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Identify computer Login ID

Application.Username is just the name typed into

ToolsOptionsGeneralUsername

Environ("Username") is the login name.


Gord Dibben MS Excel MVP

On Wed, 15 Oct 2008 17:06:02 -0700, SJW_OST
wrote:

Your code works great.
I found this code that works as well.

Sub CaptureUserID()
'2 cells must be filled in for this. Enter a character in cell A1 & A2.

Dim rng As Range

Set rng = Sheets("Sheet3").Range("A1").End(xlDown).Offset(1, 0)

rng.Value = Now()
rng.Offset(0, 1) = Application.UserName
ActiveWorkbook.Save
End Sub

Thanks for all of your help!
Stephen W

"Barb Reinhardt" wrote:

Try this

Sub test()
Dim myUserName As String
Dim objNetwork As Object
Set objNetwork = CreateObject("Wscript.network")
myUserName = objNetwork.UserName
Debug.Print myUserName
End Sub

There may be another way, but it works

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"SJW_OST" wrote:

I am looking for a way to have Excel identify and record the ID used to log
onto the computer as a way of identifying who has accessed/opened the Excel
file. So if I open the Excel file, I want the workbook to record my computer
Login ID on a sheet in cell A1. Then if my coworker opens the file I want
their ID to be recorded under mine in cell A2, the next coworker in cell A3
and so forth.
I found a way to do this operation in Access but now I need the same thing
in Excel.

Any help is greatly appreciated!
Stephen W


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
Identify User, Copy/Paste Login Info. to File on C:\ ryguy7272 Excel Programming 7 July 29th 08 04:36 PM
Identify User, Copy/Paste Login Info. to External File ryguy7272 Excel Programming 2 March 30th 08 06:01 PM
Formulaed cell response varies from computer to computer WKH Excel Discussion (Misc queries) 3 November 21st 07 06:37 PM
Display size difference- PC computer vs. Mac computer? dk_ Excel Discussion (Misc queries) 1 October 17th 06 05:48 AM
Autocomplete works with my home computer but not the office computer Andy Excel Discussion (Misc queries) 4 December 11th 04 07:21 PM


All times are GMT +1. The time now is 10:14 AM.

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"