View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Metallo[_4_] Metallo[_4_] is offline
external usenet poster
 
Posts: 21
Default PSW for Macro & Codes

Peter,

Yes, you misunderstood.
read my following mail, please.
I need to protect the sheets first with a password and then use vba to hide
it.

Alex
"Peter Beach" wrote in message
...
Hi Alex,

The password is hidden by XL. You enter your own choice of password and
unless the user knows the password they won't be able to unprotect the

code.
They will still be able to use the workbook, but they just won't have

access
to the VBA code. Am I misunderstanding something?

BTW be aware that these passwords are relatively easily cracked by
commercial products.

Regards,

Peter Beach

"Metallo" wrote in message
...
Peter,

What you gave me is the final part.
What I need is to add a password in the code so that the user cannot
unprotect the sheets.
Then I will use the function you described to hide the password in the

code.

Thanks
Alex

"Peter Beach" wrote in message
...
Hi Alex,

If by PSW you mean "password", go to the Project Explorer (normally

docked
to the left-hand side of the screen) and right click with the mouse on

the
VBA Project item and select Properties. A window will pop up, go to

the
Protection Tab and set your password and enable protection.

HTH

Peter Beach

<snip

I want to add a PSW to avoid that the users do mistakes or changes

in
the
WS

What is the code I can use to add the PSW and where shall I place

it?

My intention is to use the VBA project properties to hide the PSW.

Thank you
Alex