PROTECT MACRO IN NEW WORKBOOK

K

K

Hi all, I have workbook in which every sheet have macros in Sheet
module and macro is password proted in this workbook. But some time I
have to copy one of the sheets from this workbook to some other
workbook and which I do by right clicking on tab and selecting "Move
or Copy". The problem is that once the sheet is copied to other
workbook then any body can see the macro which is in sheet module by
going into "View Code" as its not possible in original workbook as
macro is protected in that workbook. Beause the macro in new workbook
where the sheet been copied is not protected thats why its easy to
see. Can any firend have code that which "Move or Copy" the current
sheet into other workbook and protect the macro as well in new
workbook so no one can see the macro. I know how to protect macro
manually does any firend have code to do this. any help will be much
appriciated
 
J

Jim Rech

As a practical matter I don't think you can do what you want. The only
suggestion I have is to keep the absolute minimum code possible in each
sheet module, moving the other code into a standard module. Of course when
a sheet is copied to a new workbook the sheet code will no longer work so
this suggestion is viable only if that's okay.

--
Jim
| Hi all, I have workbook in which every sheet have macros in Sheet
| module and macro is password proted in this workbook. But some time I
| have to copy one of the sheets from this workbook to some other
| workbook and which I do by right clicking on tab and selecting "Move
| or Copy". The problem is that once the sheet is copied to other
| workbook then any body can see the macro which is in sheet module by
| going into "View Code" as its not possible in original workbook as
| macro is protected in that workbook. Beause the macro in new workbook
| where the sheet been copied is not protected thats why its easy to
| see. Can any firend have code that which "Move or Copy" the current
| sheet into other workbook and protect the macro as well in new
| workbook so no one can see the macro. I know how to protect macro
| manually does any firend have code to do this. any help will be much
| appriciated
 

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