Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log UserID
How do I automatically store the NTUser's logonId to an excel file once it is
opened? I have an excel file that pulls records from a database. Since multiple users can access the database at the same time, I would like to flag a record once it is retrieved. I got the flag part down but would also like to update the record with userId to track what user retrieved what records. How do I pull the NTUserID and store it in the spreadsheet? Everytime the excel file is opened, I would like to store the NTUser ID in a cell so I can pull that value and store it into the database. I just need to know how I can get the logonId stored to the cell. Any ideas? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log UserID
try this
MsgBox Environ("UserName") It returns the NT username. HTH "JJ" wrote: How do I automatically store the NTUser's logonId to an excel file once it is opened? I have an excel file that pulls records from a database. Since multiple users can access the database at the same time, I would like to flag a record once it is retrieved. I got the flag part down but would also like to update the record with userId to track what user retrieved what records. How do I pull the NTUserID and store it in the spreadsheet? Everytime the excel file is opened, I would like to store the NTUser ID in a cell so I can pull that value and store it into the database. I just need to know how I can get the logonId stored to the cell. Any ideas? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log UserID
Sorry I assumed that you know how to place that in a cell (which is probably
the case but jut to be thourough) sheet1.range("A1").value = environ("UserName") HTH "Jim Thomlinson" wrote: try this MsgBox Environ("UserName") It returns the NT username. HTH "JJ" wrote: How do I automatically store the NTUser's logonId to an excel file once it is opened? I have an excel file that pulls records from a database. Since multiple users can access the database at the same time, I would like to flag a record once it is retrieved. I got the flag part down but would also like to update the record with userId to track what user retrieved what records. How do I pull the NTUserID and store it in the spreadsheet? Everytime the excel file is opened, I would like to store the NTUser ID in a cell so I can pull that value and store it into the database. I just need to know how I can get the logonId stored to the cell. Any ideas? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log UserID
See mr Erlandsen's page
http://www.erlandsendata.no/english/...nvbaosusername or Chris Rae's page http://www.chrisrae.com/vba/routines.html -- Regards, Tom Ogilvy "JJ" wrote in message ... How do I automatically store the NTUser's logonId to an excel file once it is opened? I have an excel file that pulls records from a database. Since multiple users can access the database at the same time, I would like to flag a record once it is retrieved. I got the flag part down but would also like to update the record with userId to track what user retrieved what records. How do I pull the NTUserID and store it in the spreadsheet? Everytime the excel file is opened, I would like to store the NTUser ID in a cell so I can pull that value and store it into the database. I just need to know how I can get the logonId stored to the cell. Any ideas? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I track changes made to a shared file per userid. | Excel Discussion (Misc queries) | |||
Script a userid and password (apache) | Excel Programming | |||
DSN UserId and Password Prompt | Excel Programming | |||
DSN UserId and Password Prompt | Excel Programming | |||
FileSystemObject CopyFile with UserID/Password | Excel Programming |