Protecting worksheets

  • Thread starter Thread starter toocold
  • Start date Start date
T

toocold

Good afternoon,

I am working on a workbook that will be used by users of varyin
computer skills. I am creating an interface that uses forms for th
users to input required data. My concern is that while I don't allo
users to get to the excel worksheets once they have enabled the macros
all they have to do is select disable macros when the workbook firs
starts up. They could then mess up the worksheets or worse the data o
those sheets. :mad:

So I was wondering if there is a way to disable this feature for
specific workbook? If not, can anyone suggest how I can accomplis
what I am looking to do?

I was thinking of using "Protect Sheets" on close and then "Unprotec
sheets" on open but I am not sure how to do this and apply it to al
the sheets. And would it work if new sheets were imported using VBA?
Basically is there a way to apply that to everysheet in the workbook?

Thanks for any assistance!
d
 
all you need to do is to set displayalerts = false on exit. When you
open it should go straight into the macro.
 
Thanks Justin,

Just one quick question, will that only apply to this one workbook? O
will it prevent the choice for all workbooks?

I only want to do it for the one workbook.

Cheers,
d
 
Putting it in the sheet code will apply it to the corresponding
workbook. I am not sure how to make this apply to all workbooks
besides putting it in all sheet codes.

-justin
 
Hi Justin,

No that would be perfect. I only want it to apply to the one workboo
but I must be a little slow, because it hasn't worked for me yet.

Within the workbook, I have put it under Microsoft objects, in th
"ThisWorkbook".

Basically this is the code that I used:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

displayalerts = false

End Sub

Is this what you meant because it doesn't prevent the security warnin
on opening. People still get to choose to disable the macros and g
straight to the worksheets.

Any thoughts
 
Ok a much easier way that requires no code would be to go to
Tools-->Macro-->Security. Set the security to low. Doing this will
automatically open the document without a confirmation. Low security
should only be used if you are sure that the document is safe and you
can monitor who uses it. This should solve your problem. Let me know!

-Justin
 
oh and this will be applied to just the workbook you are in...you can
set this for each workbook you need.
 
I'm sorry I was just confused. Theoretically, there is no way to
remove that dialog box. It is there to prevent users from opening
macros that could contain viruses. However, if you are aware of this
and can ensure that only safe documents will be opened from your
computer you do the following:

Go to Tools-->Macro-->Security.
Set the security to low.

Doing this will eliminate the confirmation dialog on open. However,
this will change it for every workbook, which I dont think you wanted.
Unfortunately this is the only option. I would also only do this if
you have some sort of security software installed as it will act as an
additional protection for your documents.

Sorry about my bad information before.

-Justin
 

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

Back
Top