PDA

View Full Version : Protect VBA Project one workbook through Another Workbook in VBA



mailmaverick
12-03-2013, 05:29 AM
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.

Bob Phillips
12-03-2013, 06:33 AM
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?

GTO
12-03-2013, 09:36 PM
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/SetVBAProjectPassword.html

http://www.vbaexpress.com/forum/showthread.php?2891-Solved-SendMessage-vs-SendKeys&highlight=

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

Hope that helps,

Mark

mailmaverick
12-04-2013, 02:13 AM
Dear All

Thanks for your valuable replies.