Lock single Module ONLY in workbook; without locking VBA project?

K

Kootenay

I have a workbook(1), contains a worksheet that once filled with use
entered parameters, generates data through a VBA module (macro). Thi
module(1) is a proprietary algorithm, and the author has locked the VB
project to protect the module from being tampered with/modified (an
rightly so).

I take this data and use it as input in my own algorithms to generat
more data. By locking "VBA project" in that workbook(1), I can't se
anyway to add my own module(2) to that particular workbook(1). I ca
create another workbook(2), and write a module(2) there that reads th
data from the first workbook(1), but then I'm left with TWO workbook
to do a single task, both have to be opened, and its just not a ver
elegant way of doing things.

I've contacted the author of the proprietary module(1), and he has n
problem modifying the lock protection in the workbook(1) so that onl
his module(1) is locked, but VBA is not really his forte, and h
doesn't know how to do it, or if it is even possible. I've checked man
Excel Help facilities, and could not find an answer.

Anyway to lock a SINGLE VBA module within a workbook?

Also, is there only ONE VBA project allowed per workbook? If I coul
add an unprotected VBA project, I could add my own module.

Thanks for any help
 
T

Tim Williams

As far as I know, only one project per workbook, and that project will have
"all or none" protection.
It's not possible to lock only part of a project.

The "secret" algorithm might be better converted to an add-in whose code
would allow you to pass either all of the required input parameters or a
reference to a fixed format "input" sheet, which could be added to your
project.

Tim
 
K

Kootenay

Thanks for your help Tim;

You have confirmed what I suspected, I'm a little surprised that the
protection is not a little more flexible, but cest la vie.

Ha! the algorithm is not really that "secret" :) I think the author
just wants to ensure it remains intact, and altered versions aren't
copied and sent all over, producing garbage output for unsuspecting
users. If it was visible, I don't think he would really care much.

Do you know of any way to run a module in a protected VB project (this
case) from another module in a 2nd workbook? I tried this as well, and
doesn't seem to work either.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top