Restrict access to only one sheet

S

stewart

I have a database in excel (I know MS Access would be better) with
employee names, phone numbers, locker numbers etc. I have a userform
that allows me to select a specific report I want to see (ie Locker
assignment, emergency contacts etc) Is once the report is completed a
smaller user form opens up with the option to close or print the
report. Is there a way to restrict access to other sheets/options
while the report is open. I have ShowModal set to false to allow them
to scroll through the report but they can also click around to other
areas of the workbook, My intention is to force them to use the close
button on my form rather than move on to something else. Is this
possible?
 
J

JLGWhiz

If you know which sheet is active at the time the report form is open, you
could use a sheet deactivate event with and If statement to automatically
close the form.

psuedo code:

Private Sub Worksheet_Deactivate()
If myReport.Enabled = True Then
Unload myReport
End If
End Sub

I'm not sure what exactly comprises your report, but this
should give you an idea of how to do what you want.
 
D

Dave Peterson

I don't think so.

Anything that you try will be macro based (I'd bet) and macros can be disabled.

And if your information is something that shouldn't be seen by others, then
don't put it in excel--if you have to put it in excel, then don't share the
workbook with others.
 
J

john

Stewart,
Dave is right, macros can be disabled and in general, it’s not a good idea
to put sensitive data in Excel which is shared by others.
Having said that, I was presented with a similar problem my daughter had at
her work. She needed 50 + people to read / write to a database table which
she insisted must be an Excel spreadsheet. My solution was to develop a user
interface as an Addin which is installed on each user’s machine. The Addin
would access a shared protected workbook on the network as the database. It’s
not perfect & not totally secure but it does work. The downside however, it
involved miles of coding & hours of work to debug!
Not sure if any of this helps but may give you some ideas.
 
S

stewart

Stewart,
Dave is right, macros can be disabled and in general, it's not a good idea
to put sensitive data in Excel which is shared by others.
Having said that, I was presented with a similar problem my daughter had at
her work. She needed 50 + people to read / write to a database table which
she insisted must be an Excel spreadsheet. My solution was to develop a user
interface as an Addin which is installed on each user's machine. The Addin
would access a shared protected workbook on the network as the database. It's
not perfect & not totally secure but it does work. The downside however, it
involved miles of coding & hours of work to debug!
Not sure if any of this helps but may give you some ideas.

I'm not really looking for something in the way of securing private
data but more in the way of making sure that if someone besides myself
uses the workbook that I can stop them from moving on to something
else until they have clicked my close button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top