+ Reply to Thread
Results 1 to 10 of 10

Protecting a VBA Project from viewing

Hybrid View

  1. #1
    William Benson
    Guest

    Protecting a VBA Project from viewing

    I need to protect a workbook's VBA project. But I do not know how to do this
    while at the same time preserving the right to set and unset references to
    dll's at runtime (My code adds the solver add-in and sets a project
    reference to it). Not only that, I cannot let the user set a reference
    manually and save the workbook, because I would have to give them the VBA
    Project password in order to make this change.

    I might save a workbook with reference already set, prior to distributing,
    but I am sure that will result in broken links for some users.

    Can someone help me out of this Catch 22? My client does not want the
    project viewable.

    Is the answer to build compiled modules in an ActiveX.DLL? He doesn't want
    to pay for that as of now.

    Bill Benson



  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Bill,

    If your company has such high concerns about program security, I would suggest you look into developing a web based interface. Far less expensive than many other options and provides with ablity to prevent users from viewing or changing the code.

    Sincerely,
    Leith Ross
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    William Benson
    Guest

    Re: Protecting a VBA Project from viewing

    That's a thought but I don't know how to do that and I am only getting a
    couple hundred for building this application as a standalone (and it's
    basically done).

    I appreciate your response, but at this juncture just trying to make sure it
    is a unsolvable conundrum with the present methods.

    The client is going to distribute this workbook to their clients, no web
    hosting of the solution.

    "Leith Ross" <Leith.Ross.1xakqa_1129964709.7242@excelforum-nospam.com> wrote
    in message news:Leith.Ross.1xakqa_1129964709.7242@excelforum-nospam.com...
    >
    > Hello Bill,
    >
    > If your company has such high concerns about program security, I would
    > suggest you look into developing a web based interface. Far less
    > expensive than many other options and provides with ablity to prevent
    > users from viewing or changing the code.
    >
    > Sincerely,
    > Leith Ross
    >
    >
    > --
    > Leith Ross
    >
    >
    > ------------------------------------------------------------------------
    > Leith Ross's Profile:
    > http://www.excelforum.com/member.php...o&userid=18465
    > View this thread: http://www.excelforum.com/showthread...hreadid=478438
    >




  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Bill,

    I guess you already have thought about using a password to protect the workbook project. Not the securest measure, but it may be your best bet at this point. The combination of the password with a copyright notice would be my choice to protect my work. I wish you well with the project.

    Sincerely,
    Leith Ross

  5. #5
    Tim Williams
    Guest

    Re: Protecting a VBA Project from viewing

    You could always use two workbooks: one protected one with all the
    "secret" stuff and one unprotected one which has the solver reference.
    You could then expose the solver functions through the second workbook
    to your code in the first one.

    Caveat: never done this. But seems like it should work.

    Tim.


    "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in
    message news:eh94P0s1FHA.3756@TK2MSFTNGP10.phx.gbl...
    >I need to protect a workbook's VBA project. But I do not know how to
    >do this while at the same time preserving the right to set and unset
    >references to dll's at runtime (My code adds the solver add-in and
    >sets a project reference to it). Not only that, I cannot let the user
    >set a reference manually and save the workbook, because I would have
    >to give them the VBA Project password in order to make this change.
    >
    > I might save a workbook with reference already set, prior to
    > distributing, but I am sure that will result in broken links for
    > some users.
    >
    > Can someone help me out of this Catch 22? My client does not want
    > the project viewable.
    >
    > Is the answer to build compiled modules in an ActiveX.DLL? He
    > doesn't want to pay for that as of now.
    >
    > Bill Benson
    >
    >




  6. #6
    William Benson
    Guest

    Re: Protecting a VBA Project from viewing

    That is an interesting approach, and I will have to try it out. In the
    meantime, another wrinkle: Solver will not work on a protected worksheet.

    What a roller coaster I have been on. I was so excited when I found I could
    install solver with code, then found out it will not work on a protected
    worksheet.

    Then was excited when I found out I could invoke it while on an unprotected
    sheet, then let down again when I got a message saying target cell had to be
    on an active sheet.

    There is no workaround for this, I don't think, but I am going to keep
    chewing on it



    "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    news:ex1Ese31FHA.164@TK2MSFTNGP10.phx.gbl...
    > You could always use two workbooks: one protected one with all the
    > "secret" stuff and one unprotected one which has the solver reference. You
    > could then expose the solver functions through the second workbook to your
    > code in the first one.
    >
    > Caveat: never done this. But seems like it should work.
    >
    > Tim.
    >
    >
    > "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in message
    > news:eh94P0s1FHA.3756@TK2MSFTNGP10.phx.gbl...
    >>I need to protect a workbook's VBA project. But I do not know how to do
    >>this while at the same time preserving the right to set and unset
    >>references to dll's at runtime (My code adds the solver add-in and sets a
    >>project reference to it). Not only that, I cannot let the user set a
    >>reference manually and save the workbook, because I would have to give
    >>them the VBA Project password in order to make this change.
    >>
    >> I might save a workbook with reference already set, prior to
    >> distributing, but I am sure that will result in broken links for some
    >> users.
    >>
    >> Can someone help me out of this Catch 22? My client does not want the
    >> project viewable.
    >>
    >> Is the answer to build compiled modules in an ActiveX.DLL? He doesn't
    >> want to pay for that as of now.
    >>
    >> Bill Benson
    >>
    >>

    >
    >




  7. #7
    Norman Jones
    Guest

    Re: Protecting a VBA Project from viewing

    Hi Bill,

    If Solver is run from VBA, try unprotectng / reprotecting the sheet around
    the solver code.

    If the user invokes Solver, consider providing access to Solver via a button
    whose code performs the unprotect / reprotect steps.

    ---
    Regards,
    Norman


    "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in message
    news:epDajc41FHA.2964@TK2MSFTNGP09.phx.gbl...
    > That is an interesting approach, and I will have to try it out. In the
    > meantime, another wrinkle: Solver will not work on a protected worksheet.
    >
    > What a roller coaster I have been on. I was so excited when I found I
    > could install solver with code, then found out it will not work on a
    > protected worksheet.
    >
    > Then was excited when I found out I could invoke it while on an
    > unprotected sheet, then let down again when I got a message saying target
    > cell had to be on an active sheet.
    >
    > There is no workaround for this, I don't think, but I am going to keep
    > chewing on it
    >
    >
    >
    > "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    > news:ex1Ese31FHA.164@TK2MSFTNGP10.phx.gbl...
    >> You could always use two workbooks: one protected one with all the
    >> "secret" stuff and one unprotected one which has the solver reference.
    >> You could then expose the solver functions through the second workbook to
    >> your code in the first one.
    >>
    >> Caveat: never done this. But seems like it should work.
    >>
    >> Tim.
    >>
    >>
    >> "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in
    >> message news:eh94P0s1FHA.3756@TK2MSFTNGP10.phx.gbl...
    >>>I need to protect a workbook's VBA project. But I do not know how to do
    >>>this while at the same time preserving the right to set and unset
    >>>references to dll's at runtime (My code adds the solver add-in and sets a
    >>>project reference to it). Not only that, I cannot let the user set a
    >>>reference manually and save the workbook, because I would have to give
    >>>them the VBA Project password in order to make this change.
    >>>
    >>> I might save a workbook with reference already set, prior to
    >>> distributing, but I am sure that will result in broken links for some
    >>> users.
    >>>
    >>> Can someone help me out of this Catch 22? My client does not want the
    >>> project viewable.
    >>>
    >>> Is the answer to build compiled modules in an ActiveX.DLL? He doesn't
    >>> want to pay for that as of now.
    >>>
    >>> Bill Benson
    >>>
    >>>

    >>
    >>

    >
    >




  8. #8
    William Benson
    Guest

    Re: Protecting a VBA Project from viewing

    Thanks Norman. I am running solver using SendKeys for now, because I cannot
    run it with VBA because I cannot be sure there is a reference to the Solver
    add-in on user machines. I am using the button approach, and unprotecting on
    click, SendKeys to call solver, and reprotecting on
    Worksheet_SelectionChange. I have no other way to reprotect because the user
    has control once solver is launched. Certainly if I caould use VBA, it would
    be simpler.

    Bill
    "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    news:OggOgs41FHA.2132@TK2MSFTNGP15.phx.gbl...
    > Hi Bill,
    >
    > If Solver is run from VBA, try unprotectng / reprotecting the sheet around
    > the solver code.
    >
    > If the user invokes Solver, consider providing access to Solver via a
    > button whose code performs the unprotect / reprotect steps.
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in message
    > news:epDajc41FHA.2964@TK2MSFTNGP09.phx.gbl...
    >> That is an interesting approach, and I will have to try it out. In the
    >> meantime, another wrinkle: Solver will not work on a protected
    >> worksheet.
    >>
    >> What a roller coaster I have been on. I was so excited when I found I
    >> could install solver with code, then found out it will not work on a
    >> protected worksheet.
    >>
    >> Then was excited when I found out I could invoke it while on an
    >> unprotected sheet, then let down again when I got a message saying target
    >> cell had to be on an active sheet.
    >>
    >> There is no workaround for this, I don't think, but I am going to keep
    >> chewing on it
    >>
    >>
    >>
    >> "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    >> news:ex1Ese31FHA.164@TK2MSFTNGP10.phx.gbl...
    >>> You could always use two workbooks: one protected one with all the
    >>> "secret" stuff and one unprotected one which has the solver reference.
    >>> You could then expose the solver functions through the second workbook
    >>> to your code in the first one.
    >>>
    >>> Caveat: never done this. But seems like it should work.
    >>>
    >>> Tim.
    >>>
    >>>
    >>> "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in
    >>> message news:eh94P0s1FHA.3756@TK2MSFTNGP10.phx.gbl...
    >>>>I need to protect a workbook's VBA project. But I do not know how to do
    >>>>this while at the same time preserving the right to set and unset
    >>>>references to dll's at runtime (My code adds the solver add-in and sets
    >>>>a project reference to it). Not only that, I cannot let the user set a
    >>>>reference manually and save the workbook, because I would have to give
    >>>>them the VBA Project password in order to make this change.
    >>>>
    >>>> I might save a workbook with reference already set, prior to
    >>>> distributing, but I am sure that will result in broken links for some
    >>>> users.
    >>>>
    >>>> Can someone help me out of this Catch 22? My client does not want the
    >>>> project viewable.
    >>>>
    >>>> Is the answer to build compiled modules in an ActiveX.DLL? He doesn't
    >>>> want to pay for that as of now.
    >>>>
    >>>> Bill Benson
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




  9. #9
    Norman Jones
    Guest

    Re: Protecting a VBA Project from viewing

    Hi Bill,


    > Thanks Norman. I am running solver using SendKeys for now, because I
    > cannot run it with VBA because I cannot be sure there is a reference to
    > the Solver



    See the following suggestions from Dana DeLouis for VBA code to add a
    reference to solver:

    http://tinyurl.com/bmfmr

    ---
    Regards,
    Norman



    "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in message
    news:ODWfNdE2FHA.2056@TK2MSFTNGP10.phx.gbl...
    > Thanks Norman. I am running solver using SendKeys for now, because I
    > cannot run it with VBA because I cannot be sure there is a reference to
    > the Solver add-in on user machines. I am using the button approach, and
    > unprotecting on click, SendKeys to call solver, and reprotecting on
    > Worksheet_SelectionChange. I have no other way to reprotect because the
    > user has control once solver is launched. Certainly if I caould use VBA,
    > it would be simpler.
    >
    > Bill
    > "Norman Jones" <normanjones@whereforartthou.com> wrote in message
    > news:OggOgs41FHA.2132@TK2MSFTNGP15.phx.gbl...
    >> Hi Bill,
    >>
    >> If Solver is run from VBA, try unprotectng / reprotecting the sheet
    >> around the solver code.
    >>
    >> If the user invokes Solver, consider providing access to Solver via a
    >> button whose code performs the unprotect / reprotect steps.
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >> "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in
    >> message news:epDajc41FHA.2964@TK2MSFTNGP09.phx.gbl...
    >>> That is an interesting approach, and I will have to try it out. In the
    >>> meantime, another wrinkle: Solver will not work on a protected
    >>> worksheet.
    >>>
    >>> What a roller coaster I have been on. I was so excited when I found I
    >>> could install solver with code, then found out it will not work on a
    >>> protected worksheet.
    >>>
    >>> Then was excited when I found out I could invoke it while on an
    >>> unprotected sheet, then let down again when I got a message saying
    >>> target cell had to be on an active sheet.
    >>>
    >>> There is no workaround for this, I don't think, but I am going to keep
    >>> chewing on it
    >>>
    >>>
    >>>
    >>> "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    >>> news:ex1Ese31FHA.164@TK2MSFTNGP10.phx.gbl...
    >>>> You could always use two workbooks: one protected one with all the
    >>>> "secret" stuff and one unprotected one which has the solver reference.
    >>>> You could then expose the solver functions through the second workbook
    >>>> to your code in the first one.
    >>>>
    >>>> Caveat: never done this. But seems like it should work.
    >>>>
    >>>> Tim.
    >>>>
    >>>>
    >>>> "William Benson" <wbenson(nospamplease)@vbacreations.com> wrote in
    >>>> message news:eh94P0s1FHA.3756@TK2MSFTNGP10.phx.gbl...
    >>>>>I need to protect a workbook's VBA project. But I do not know how to do
    >>>>>this while at the same time preserving the right to set and unset
    >>>>>references to dll's at runtime (My code adds the solver add-in and sets
    >>>>>a project reference to it). Not only that, I cannot let the user set a
    >>>>>reference manually and save the workbook, because I would have to give
    >>>>>them the VBA Project password in order to make this change.
    >>>>>
    >>>>> I might save a workbook with reference already set, prior to
    >>>>> distributing, but I am sure that will result in broken links for some
    >>>>> users.
    >>>>>
    >>>>> Can someone help me out of this Catch 22? My client does not want the
    >>>>> project viewable.
    >>>>>
    >>>>> Is the answer to build compiled modules in an ActiveX.DLL? He doesn't
    >>>>> want to pay for that as of now.
    >>>>>
    >>>>> Bill Benson
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




+ 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