ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Function "User()" to provide access to workbook (https://www.excelbanter.com/excel-programming/287677-function-user-provide-access-workbook.html)

Wayne[_5_]

Function "User()" to provide access to workbook
 
Using WindowsXP_OS and Office 97 (Excel 97)...

I've created a function in a module and set cell A1
to "=User()"
This provides the user name within this cell.

I want to be able to lookup the user name within this
cell and providing the user is authorised to use the
workbook then they can proceed, otherwise I want excel to
close the workbook.

Eg. Jim Smith OK to use
Fred Bloggs OK to use
Any other user exit excel

Any Help would be a great help!!!!!


mudraker[_89_]

Function "User()" to provide access to workbook
 
I have only used this on Windows NT logged onto a LAN to get the users
ID ,so I do not know if it will work in your situation

UserName = Environ$("UserName")


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 02:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com