Hi Midhun,

 

I like Paul's thorough response.

 

I thought I'd mention that there is a simpler / easier-to-remember way of
detecting the logged-in user's name from a macro:

Function ReturnUserName() As String

    UserName = Environ("USERNAME")

End Function

 

It is slightly less secure, since the environment variable could be fairly
easily modified by a knowledgeable user (in other words Paul's method is
actually preferable).  But no security you implement in Excel will be "high
security" anyway.

 

If the data you are hiding is of an actual confidential nature, I would
recommend instead using a macro to generate a copy of the spreadsheet that
only contains the data for a single user, and sending that to the end-user.

 

Asa

 

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Paul Schreiner
Sent: Monday, September 10, 2012 12:06 PM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ detecting loggedin user

 

Here's something I threw together from macros I already had.

I didn't spend too much time on it.

I hope they have what you're looking for.

 

There are several things you MENTIONED that I tried to include.

Since you want the user to view ONLY his performance, 

I added filters to the "YTD Output" sheet and protected it with a password
"testpassword".

(you can change it to whatever you wish)

The file should be saved with only blank rows displayed and password
protected.

You'll also want to password protect  your VBA project so that the users
won't be able to 

open the VBEditor and read the sheet password.

 

When the user opens the file, it determines the user's ID based on his/her
Windows login.

It then updates the Userid in the "YTD Performance" sheet.

 

A change Event on this sheet checks for a changed userid and calls a
function

that unprotects the Output sheet, changes the filter to include only the
userid,

then re-protects the sheet.

 

hope this gives you enough to work with to complete your task.
 

Paul

-----------------------------------------
"Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can." - John Wesley
-----------------------------------------

 

 

  _____  

From: Midhun Thampan <midhun.tham...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Mon, September 10, 2012 1:04:27 PM
Subject: $$Excel-Macros$$ detecting loggedin user

Hi All;

This is a excel file which has a database which will be locked.

Just need a code tht will detect only the information of user who logs
on the computer.
Our system is logged in via 5 digit userid so as someone opens this
file his userid should detected so tht he can only view his particular
performance..

Kindly help, i tried but did not work.


-- 
Midhun

-- 
Join official facebook page of this forum @
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security
measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups
"MS EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to
excel-macros+unsubscr...@googlegroups.com.



-- 
Join official facebook page of this forum @
https://www.facebook.com/discussexcel
 
FORUM RULES (1120+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
6) Jobs posting is not allowed.
 
7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups
"MS EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to
excel-macros+unsubscr...@googlegroups.com.
 
 

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.


Reply via email to