Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default update user name in excel on open

We have a standard build on our PC's that returns a generic user on excel if
people havent updated their User Name details in the 'Tools', 'Options',
'General' tab.

I want to be able to capture the users NT logon and write this to the user
name field in excel so that it stores this permanantly whenever they open
this workbook.

I have tried to google etc but cant see anything that updates this field but
loads that store the username in the book.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default update user name in excel on open

From workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the
left treeview search for the workbook name and click on + to expand it.
Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

Private Sub Workbook_Open()
Application.UserName = Environ("Username")
End Sub

--
Jacob (MVP - Excel)


"fishy" wrote:

We have a standard build on our PC's that returns a generic user on excel if
people havent updated their User Name details in the 'Tools', 'Options',
'General' tab.

I want to be able to capture the users NT logon and write this to the user
name field in excel so that it stores this permanantly whenever they open
this workbook.

I have tried to google etc but cant see anything that updates this field but
loads that store the username in the book.

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
Forcing cell with user function to update on workbook open? Don Wiss Excel Programming 2 April 6th 07 01:30 AM
how do I prompt a user to update a cell in Excel? martb Excel Discussion (Misc queries) 1 September 12th 05 01:43 PM
Excel User Conference Update Damon Longworth Excel Programming 2 July 8th 05 01:57 PM
Excel User Conference update Damon Longworth Excel Discussion (Misc queries) 0 July 8th 05 01:19 PM
How do I set up an excel spreadsheet to update every time a user . Jennie New Users to Excel 1 December 20th 04 08:42 PM


All times are GMT +1. The time now is 05:30 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"