preventing access to the vba code in an excel workbook?

  • Thread starter Thread starter neowok
  • Start date Start date
N

neowok

basically ive got vba code which enables and disables protection on th
sheets when a button is pressed so that the search can work whil
keeping the sheet protected from anyone changing it.

the problem is anyone can see the password being used by right clickin
the sheet tab and going to view code, or clicking the vb view cod
button.

in the vb editor you can go to properties and put "protection" on s
they need a password to view the vba code, which is what i want. th
problem now is that you cannot save the file without first opening th
vb editor and entering the bluddy password, if you try it gives a
error saying "you cannot save to this filetype when the vba project i
protected" and it tells you to enter the password to turn th
protection off before saving. The problem is it does this EVERY tim
you try to save the file, whether something has been changed in th
sheet or not.

There must surely be a 'sensible' way to prevent access to the vba cod
without having this rediculous prompt every single time you try to sav
the file
 
Hi Neowok,
in the vb editor you can go to properties and put "protection" on so
they need a password to view the vba code, which is what i want. the
problem now is that you cannot save the file without first opening the
vb editor and entering the bluddy password, if you try it gives an
error saying "you cannot save to this filetype when the vba project is
protected" and it tells you to enter the password to turn the
protection off before saving. The problem is it does this EVERY time
you try to save the file, whether something has been changed in the
sheet or not.

This sounds like you are saving to a mixed filetype called:

"Microsoft Excel 97-2002 & 5.0/95 Workbook"

This should not be necessary, save-as the file to normal workbook format
and all should be OK.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 

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