Protect Macro

K

K

Hi all, I have macro in Worksheet module and I have another macro in
normal module which "Move or Copy" the Worksheet which contain the
macro into other files. My orginal file macro is protected but when I
run "Move or Copy" macro and when it transfer the worksheet into other
file then people can see the macro which is in worsheet module. is
there any way that when i run macro to transfer the worksheet into
other file then macro should also protect the worksheet module into
other file. If any body can help it will be much appriciated.
 
D

Dave Peterson

You can't protect individual modules of a workbook's project. It's everything
or nothing.
 
K

K

You can't protect individual modules of a workbook's project.  It's everything
or nothing.

Thanks for replying Dave. What about if i want whole workbook project
to be protected by vba. is it possible
 
D

Dave Peterson

You can protect the workbook's project manually, but there's nothing built into
excel that allows you to do this mechanically.

You could fiddle with Sendkeys, but I've never seen that be an effect way to go.

Maybe you could protect the receiving workbook's project and then when you do
the move or copy, you'll be ok.

If you're moving/copying to a new workbook, then create a workbook template and
protect its project.

Then you can use that template to create a new workbook first. And then
move/copy into that workbook.
 

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