ThisWorkbook.Close()
Hi Robert,
Am Thu, 20 Nov 2014 01:14:01 -0700 schrieb Robert Crandal:
Does anyone see any problems with this approach?
Are there better solutions to restricting access to
workbooks? I'm curious what you think.
if a PC is started and the user is logged in the Environ("UserName") is
always correct for everyone you works with this PC.
If the users have also to log in for Excel you can match
Environ("UserName") with Application.Username.
Or you match the workbook author with the environ("UserName"):
If Thisworkbook.BuiltInDocumentProperties("Author") <
Environ("UserName")
Or:
If Thisworkbook.BuiltInDocumentProperties(3) < Environ("UserName")
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|