Consulting

Results 1 to 4 of 4

Thread: Protect VBA Project one workbook through Another Workbook in VBA

  1. #1

    Protect VBA Project one workbook through Another Workbook in VBA

    Dear All

    I have a workbook named Source.xlsm.

    I am processing the data in Source workbook and generating another workbook Destination.xlsm in same folder through macro within Source.

    My VBA macro (in Source) also copies some modules from Source into Destination.

    In the end I want to protect VBA Project of Destination through my Source's macro.

    I have found SendKeys solution but that is not reliable.

    Is there any other solution ?


    Thanks.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    SendKeys is the only solution that I know of, and as you say, it's a tad flaky.

    But protecting a project is pointless IMO, what is so valuable that you want to bother with that?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings,

    While I agree with Bob (xld) that anyone serious about getting to your code will just use software to remove/change it, if the goal is simply to reduce the "know just enough to blow it up" fellow's temptation from playing with it... you could try the API SendMessage.

    Here are links to both the discussion and article from Howard Kaikow, who unfortunately later passed from this earth.

    http://www.standards.com/Office/SetV...tPassword.html

    http://www.vbaexpress.com/forum/show...Keys&highlight=

    As the original was written in VB, here is my rough-edged wb for vba (attached).

    Hope that helps,

    Mark
    Attached Files Attached Files

  4. #4
    Dear All

    Thanks for your valuable replies.

Posting Permissions

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