View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Programmatically Open Locked VBAProject

Just to add to Jon's idea...

Maybe you could create template files that contain only the procedures/functions
that you need to share. The template project's could still be protected.

Jon Peltier wrote:

The techniques are hacking, even if that's not YOUR intention, because they
would help anyone hack into a protected VB project.

If you have modules that you want to share, distribute them in another
unprotected project or as exported modules. This ensures that there are no
problems with SendKeys or with your modules' security (such as it is).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

"Michael PE" <Michael wrote in message
...
I'd like to open a password protected VBAProject via code, copy out
specific
modules, then close the project (add-in).

I have an add-in that I share with multiple functions that are used by
users. I have the add-in VBAProject password protected. This is enough to
keep the nosey out. I know it is NOT secure.

Now, I would like the user to copy modules (that I have specified) out of
the add-in vbaproject to their workbook. I have the code to copy the
module
but I cannot do it if the add-in project is locked.

How do I open the add-in VBAProject, pass the password to it, then close
it
again after it the copy module function is complete?

One Response:
What you are asking is considered hacking and you will not get any help
here
as it is against board policy. You may have to find a different way to
make
your code available to the user.


My Reply:
Okay. If it considered hacking. How do I go about sharing portions of my
code but not all of it that is contained inside my add-in without allowing
all of my code to be exposed to nosey users?

Is it still considered hacking if I know what the password is and pass it
via code to open it? For example, while researching on here, I found posts
of
how to pass the password to a protected sheet to unprotect it. Is that not
the same thing?

Why is it considered hacking if I wrote the code that is protected and
placed the password protection?

If there is a better way to copy specific modules from my
password-protected
(where I created and know the password) add-in to a users workbook, please
let me know.


--

Dave Peterson