View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default 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)