Protecting code...

  • Thread starter Thread starter Ruskin Hardie
  • Start date Start date
R

Ruskin Hardie

Hi all,

I have done a bit of development work using VBA in Excel (2000). But now I
want to stop the code from being "viewable" and "editable". Have tried using
the workbook and worksheet protection menu options, but can still push
ALT-F11 and edit the code... Have looked around the VBA side as well as the
Excel side, for any type of protection of the code. The help says I can use
the protect method, eg:
ActiveWorkbook.Protect Password:="mypassword"

Have tried this with UserInterfaceOnly:=False as well as some of the other
available arguments (such as Contents, Scenarios), but with no luck...

Can anyone point me in the right direction for this...

Thanks in advance,
Ruskin...
 
Hi. If you right-click on the VBAProject within the VB Editor, you can
select properties ... protection tab.

Geoff
 
In the VB Editor;
Right click the Project name in the Object Browser, then;
"VBA Project Properties->Protection"
Select "Lock For Viewing" and set up the password.
One little note that may/may not apply, but included, just in case;

If you do this in '97 you won't be able to access it in 2000 (I learned that
the hard way!)
Has something to do with a stronger encryption in 2000 (according to a
response I got in the ng.)
--
Regards;
Rob

Please reply to the NG, I'm already up to my eyeballs in Nigerian/South
African get rich letters
as well as "Microsoft Critical Updates" et al.
 
I bet you had trouble the other way around--if you protect the project in xl2k
(or higher), then you won't be able to open it in xl97.
 
You are right (of course).
Too many machines, too many OS's, too many versions/releases and most of
all - too many years<g>.

Thanks for the correction.

--
Regards;
Rob

Please reply to the NG, I'm already up to my eyeballs in Nigerian/South
African get rich letters
as well as "Microsoft Critical Updates" et al.
 
Back
Top