+ Reply to Thread
Results 1 to 5 of 5

security of code

  1. #1
    mike allen
    Guest

    security of code

    i have grappled w/ this for some time. i create programs that use excel
    spreasheets as input sheets, have vba code in modules called w/ buttons,
    then use excel spreadsheets as output (pretty typical of this group i would
    guess).
    my problem is i have noticed people copying these files to friends, etc. and
    i would like to prevent this. i envision something like:
    sub MainCode()
    if computerID = 12983746abg12 then 'this is the key
    else
    msgbox "this code not allowed on this particular computer"
    end
    end if
    'code here
    end sub

    the catch here is: is there a serial number, computer ID, or something that
    is unique and not easily changed w/in each individual computer? you can
    even assume nothing but stand alone pc's.
    any other thoughts if this is not possible? thanks, mike allen



  2. #2
    chuckles
    Guest

    RE: security of code

    You could try and use the computer ID or user name or similar but in all
    honesty it won’t be that reliable. An easier method would be to store a
    license key number in the registry and check for that - any reasonably long
    number would do and most users won’t go hunting for it. You’d need to make
    sure you set a password for your VBA project as well though.

    "mike allen" wrote:

    > i have grappled w/ this for some time. i create programs that use excel
    > spreasheets as input sheets, have vba code in modules called w/ buttons,
    > then use excel spreadsheets as output (pretty typical of this group i would
    > guess).
    > my problem is i have noticed people copying these files to friends, etc. and
    > i would like to prevent this. i envision something like:
    > sub MainCode()
    > if computerID = 12983746abg12 then 'this is the key
    > else
    > msgbox "this code not allowed on this particular computer"
    > end
    > end if
    > 'code here
    > end sub
    >
    > the catch here is: is there a serial number, computer ID, or something that
    > is unique and not easily changed w/in each individual computer? you can
    > even assume nothing but stand alone pc's.
    > any other thoughts if this is not possible? thanks, mike allen
    >
    >
    >


  3. #3
    mike allen
    Guest

    Re: security of code

    that sounds good, but how do you store a license key number in the registry
    and how do you have code check for it? thanks, mike allen
    "chuckles" <[email protected]> wrote in message
    news:[email protected]...
    > You could try and use the computer ID or user name or similar but in all
    > honesty it won't be that reliable. An easier method would be to store a
    > license key number in the registry and check for that - any reasonably
    > long
    > number would do and most users won't go hunting for it. You'd need to
    > make
    > sure you set a password for your VBA project as well though.
    >
    > "mike allen" wrote:
    >
    >> i have grappled w/ this for some time. i create programs that use excel
    >> spreasheets as input sheets, have vba code in modules called w/ buttons,
    >> then use excel spreadsheets as output (pretty typical of this group i
    >> would
    >> guess).
    >> my problem is i have noticed people copying these files to friends, etc.
    >> and
    >> i would like to prevent this. i envision something like:
    >> sub MainCode()
    >> if computerID = 12983746abg12 then 'this is the key
    >> else
    >> msgbox "this code not allowed on this particular computer"
    >> end
    >> end if
    >> 'code here
    >> end sub
    >>
    >> the catch here is: is there a serial number, computer ID, or something
    >> that
    >> is unique and not easily changed w/in each individual computer? you can
    >> even assume nothing but stand alone pc's.
    >> any other thoughts if this is not possible? thanks, mike allen
    >>
    >>
    >>




  4. #4
    chuckles
    Guest

    Re: security of code

    The simplest way is to use


    SaveSetting (appname, section, key[, default])
    GetSetting (appname, section, key[, default])

    which writes to, reads from
    HKEY_CURRENT_USER\Software\
    VB and VBA Program Settings\appname\section\key


    so
    SaveSetting "MyAPP", "Startup", "License", "12345"

    You can obviosuly view this by running regedit.

    the help files cover this in more detail


    "mike allen" wrote:

    > that sounds good, but how do you store a license key number in the registry
    > and how do you have code check for it? thanks, mike allen
    > "chuckles" <[email protected]> wrote in message
    > news:[email protected]...
    > > You could try and use the computer ID or user name or similar but in all
    > > honesty it won't be that reliable. An easier method would be to store a
    > > license key number in the registry and check for that - any reasonably
    > > long
    > > number would do and most users won't go hunting for it. You'd need to
    > > make
    > > sure you set a password for your VBA project as well though.
    > >
    > > "mike allen" wrote:
    > >
    > >> i have grappled w/ this for some time. i create programs that use excel
    > >> spreasheets as input sheets, have vba code in modules called w/ buttons,
    > >> then use excel spreadsheets as output (pretty typical of this group i
    > >> would
    > >> guess).
    > >> my problem is i have noticed people copying these files to friends, etc.
    > >> and
    > >> i would like to prevent this. i envision something like:
    > >> sub MainCode()
    > >> if computerID = 12983746abg12 then 'this is the key
    > >> else
    > >> msgbox "this code not allowed on this particular computer"
    > >> end
    > >> end if
    > >> 'code here
    > >> end sub
    > >>
    > >> the catch here is: is there a serial number, computer ID, or something
    > >> that
    > >> is unique and not easily changed w/in each individual computer? you can
    > >> even assume nothing but stand alone pc's.
    > >> any other thoughts if this is not possible? thanks, mike allen
    > >>
    > >>
    > >>

    >
    >
    >


  5. #5
    Tim
    Guest

    Re: security of code


    <snip>

    Another way to secure your code is to write a COM add-in. There is another
    user group that tells you how to do this. It's not a simple matter, but if
    the code is 'intellectual proporty, you should consider it.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1