Macro to lock project from viewing

C

CH

I'm looking for a macro to insert into my project to automatically
password protect and lock a project from viewing instead of manually
doing the following:

-->Going into the VBA Project (view code)
-->Tools
-->VBA Project Properties
--> Protection Tab
-->Lock Project for Viewing


Can anyone help with this?
 
D

Dave Peterson

There's no property/object in excel that allows you to do this mechanically.

About the best you can do is use SendKeys to show the dialog and choose the
options you want.

But I wouldn't depend on this working.
 

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