ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Protecting Code in Visual Basic Editor (Excel 2003) (https://www.excelbanter.com/excel-worksheet-functions/200788-protecting-code-visual-basic-editor-excel-2003-a.html)

Johnny S. NH

Protecting Code in Visual Basic Editor (Excel 2003)
 
I have 4 protected sheets in a workbook with a little vb code behind them which
includes sheet passwords. A user could click on menu bar and add VB Editor
and
then click on code module and see everything. Any way to hide all that ?
--
Johnny S.

JLatham

Protecting Code in Visual Basic Editor (Excel 2003)
 
Yes (and no).
First, the YES part: Open up the workbook and the VB Editor. From the VB
Editor menu choose Tools | VBAProject Properties and then go to the
[Protection] tab on the dialog that opens. Hide the project and enter a
password to be required to view the project later. Either write that
password down somewhere safe or keep a copy of the workbook that doesn't have
the VBA Project protected.

Now the NO part: even though the password protection for the VBA Project is
stronger than for the worksheets and/or workbook, it can still be bypassed
fairly easily with numerous tools, free and for-purchase. But it will keep
the 'casually curious' out of your code.

Another thing you can do is to create your own digital signature and sign
the project. Then if someone does get into the code and edit it, that
signature will be removed and that will clue you in about that later. But
again, there's a weakness in that self-signed signatures can be 'forged', so
it's another tool that can potentially be circumvented. Search the regular
Excel help for
create your own digital certificate
for information on how to create one and use it.

"Johnny S. NH" wrote:

I have 4 protected sheets in a workbook with a little vb code behind them which
includes sheet passwords. A user could click on menu bar and add VB Editor
and
then click on code module and see everything. Any way to hide all that ?
--
Johnny S.



All times are GMT +1. The time now is 03:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com