How to hide "View Code"
If you really want to disable the "View Code" ...
Application.CommandBars("Ply").Controls("&View Code").Enabled=False
to gray out, or
Application.CommandBars("Ply").Controls("&View Code").Visible=False
to hide.
Of course, the OP should realize that executing either of those lines of
code won't stop the user from being able to press Alt+F11 or clicking
Tools/Macro/Visual Basic Editor.
--
Rick (MVP - Excel)
|