Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'Mission Impossible' (Excel2000)

    OK so I grew up watching that program and I can't think of another subject description!

    I have been working on a VBA project for several weeks and am about to try and market it. I know there are a lot of password unlock programs out there and I want to devise a method to try and protect my code. I am not in a position to go the DLL route at this time soooo!

    What I thought of was to use some kind of event, if there is one, to capture when the project is unlocked and then ask for another password. If nothing is entered in say 5-10 seconds ALL MODULES will be DELETED! Kind of like the tape recorder on Mission Impossible.

    My problem is trying to find an event to trigger the opening of the project.

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: 'Mission Impossible' (Excel2000)

    Good question, Mr. Phelps! Your task, should you choose to accept it is to make your project into a COM Addin. All other attempts will result in the loss of your code to the enemy. There is an event that is close to the one that you desire, the AddinInstall Event of a regular Addin. But, this will mean that all of your users would have to enter a password and then they would be free to crack your project password. Good to keep the code out of the hands of the enemy, but not good enough to keep it out of the hands of spys! <img src=/S/flee.gif border=0 alt=flee width=25 height=25>
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Mission Impossible' (Excel2000)

    If you really want to protect your code, the only sure fired way is to compile it into a DLL. No matter what way of protecting your "app" someone will get around it. Just look at WPA in WinXp and OXP.

    If you use some form of timer event, your app's performance will suffer.

    At the start of each procedure, you could do a check for the project being locked, and if it is then run your delete code.

    Something like would be the first line in each procedure

    If VBE.VBProjects("MyProject").Protection = vbext_pp_none then KillProject

    This will check the protection at the start of each function and then "go" if it is unlocked.

    But for this to work, you will need to have a reference set to the VBA Extensibility library
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: 'Mission Impossible' (Excel2000)

    > check for the project being locked, and if it is then run your delete code
    That is genius, Bryan! <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

    Of course, as you said it won't fully protect. I wonder if there are any events that you can get at in the VBE. Could one maybe write a simple DLL for the VBE that would provide protection for any code in the current project? Sounds dangerous, just like Mission Impossible!
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Mission Impossible' (Excel2000)

    Thanks. I wouldn't call it genius, but if YOU want to, who am I to stop you <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    One onther thing that occured to me was, the second someone disables the macros, all of this stops working!! As does any other code based protection scheme.

    That is why a DLL is about the only way to go, although, I wouldn't bet the farm on that being 100% effective either.

    You could use the SheetCalculate event to run the check, and everytime the sheet is recalculated, the code runs.

    But like I said, as soon as you disable the macros for the project, all this goes out the window and the code is vulnerable.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •