Hi Rita999
In the attachment there's a proposal of how to do it.
It is in fact a single module self-encrypted encryptor project, or to be more precise, a single module self-encrypted encryptor proto-project.
To make it work you need to make reference to "Visual Basic for Applications Extensibility". Read also the msbox's in the code.
Some comments:
1.- Good news: it works like charm for me everytime. It took less than 1 second to do this job, and little over 30 secs for a full size 30+ modules project.
2.- Bad news: It does not perform miracles. You've got to have certain discipline in your programming habits to make it work. In my case it wasn´t such a big deal since my mother language's spanish and my naming do not usually conflict with the interface's I use (mostly Acad, MicroStation & Excel). That gives you a clue on how it works.
3.- For me programming is just another tool. I neither live for nor on it. VBA is my language of choice because it puts very powerful standard tools at your finger tips without requiring onerous time investments. It fixes reasonably well my daily problems. That's why I'm not even moving to VB: that would make me a bad programmer. I'd rather be a good user.
All this is to say that I'm giving no lessons with my style or the algoriths I use. In fact, this is one that I improvised and turned out good enough for me. Also that I know that it won't cover all possible cases (e.g. I don´t usually use the Keyword Type, so the behavior is unexpectable if it finds if. That's fairly simple to change though).
4.- I do not distribute software comercially, so it's not so much about keeping it from everybody else's eyes, but from mine. There's a simple explanation to this paradox: I have some applications working on different workstations on my own company, and they usually require retouching to adapt to new situations. Having so easy access to the source code, it's always a strong temptation making changes on demand as you go. This technique prevents chaos from happening and keeps versioning under control.
5.- I have made some changes to the standard version I use. This one makes actual changes (not just translation) to the code so it is not as easy to read. For those having to distribute stuff it might be interesting. Side effect is that can cause certain ineficiency in performance to the encrypted program. Tests I did show that it wouldn't affect much my own applications.
I've also used in this version some programming techniques that , being not required, make it more difficult to unravel the encryptor´s encrypted code, while keeping the original source clear.
6.- I wouldn´t put this code to run on my computer before making sure it won´t damage anything. All you have is my word that there's no evil in it, perhaps some bad programming, that's it. Take my advice: if that's what you need, put some of your time in trying to figure it out, and then test it on a copy of one of your projects. Else you can just drop it.
7.- Why this way?. I think it's fear enough: keeping us all from enjoing your code shouldn't go without effort.
Do not hesitate to ask.
[email protected]