![]() |
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. |
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. |
All times are GMT +1. The time now is 01:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com