VBA code protection.

  Les 11:56 11 Jun 2004

Can anyone help me with this problem.

I'm trying to protect my VBA code. When I set it up by going through Tools/VBAProject Properties/Protection, tick the box 'Lock project for viewing' and enter the password, confirm it I find that later, when I try to get to the VBA it does put up the dialog box asking for the password - entering the wrong password does, as you would expect, tell you that this is so, However, when you click on the Cancel button it puts up a warning noticve on screen saying that there was was a system error, removing this box then allows you to look through and copy the code. The code is in EXCEL 2003 ( although the actual code was written in EXCEL 97 it was copied onto a computer with the 2003 version and then protected)

Any idea on why this strange procedure should happen?


  VoG II 15:51 11 Jun 2004

I cannot replicate this problem. I have tried with a file created in Excel 97 and opened and password protected in Excel 2003 (o/s Windows XP). Earlier today I tried using a copy of the same file, opened and protected in Excel 2000 (o/s Windows 2000). In all cases pressing Cancel just "does nothing".

Have you tried other workbooks to see if this also happens? If it is just the one file it is possible that the VBA modules are corrupt. You could try cleaning them click here - the Excel 97 version works with all versions of Excel from 97 to 2003.

  Les 22:21 11 Jun 2004

Thanks for your reply - I'll follow your suggestions and have downloaded the file you 'pointed' to.

The job I've been working on now, for over a year, is nearing completion - ready for this year's tournament and, as it is now much better than last year I'd hate for someone to get hold of the code (some 230 plus workbooks!). At the moment, we have, between us, 3 versions of Excel, ie: '97, 2000 and 2003 and, as you say, the code runs OK on all of them - but I notice that when you save a file in 2003 and then use it in '97 it informs you of the fact before you can save it again in '97. If, by some chance, the program is pinched then a hidden file in another folder probably will not be and the whole program looks for that file, aborting if not present. However, VOG I'd still like to lock the code too.

I'll post the result when I get round to it as I'm busy trying to beat a 'deadline' ( the end of this month) - sounds impressive but I know the fella who is to use this prgram and computer literate he is not! He'll need the extra month to get used to it!

Thanks again.


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

iMac Pro review

Visual Trends 2018: This year’s must-know colour, design, branding & photography trends

iMac Pro review

Apple Music : comment obtenir 3 mois gratuits ?