View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
chijanzen chijanzen is offline
external usenet poster
 
Posts: 139
Default Disable Right Clicking of Excel logo on Standard menu Bar

Peter :

I live in Taiwan

My English not too good

Please do not mind

chijanzen
--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Peter Rooney" wrote:

Chijanzen,

My nine year old son "What did you at work today, dad?" was totally
intrigued by the fact that you'd signed your name in Chinese characters! I
had to explain to him that the rest of your message was in English, because
he had no idea how I'd understood your reply! :-)

Once again, another useful solution. between you and Ron, I can now either
hide the Excel logo altogether, display but disable it, or disable specific
commands within its shortcut menu! Not bad for an afternoon's work!

Once again, thank you very much.

Pete



"chijanzen" wrote:

Peter:

Other method,only Disabled viewing code CommandBarControl

Sub DisabledViewCode()
Dim Ctrl As CommandBarControl
For Each Ctrl In CommandBars.FindControls
If Ctrl.ID = 1561 Then
Ctrl.Enabled = False
End If
Next
End Sub

Sub EnabledViewCode()
Dim Ctrl As CommandBarControl
For Each Ctrl In CommandBars.FindControls
If Ctrl.ID = 1561 Then
Ctrl.Enabled = True
End If
Next
End Sub


--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Peter Rooney" wrote:

ChiJanZen,

I couldn't wait.

This is excellent!

Thank you VERY much!

Regards

Pete



"chijanzen" wrote:

Peter:

try

Application.CommandBars("Document").Enabled = False

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Peter Rooney" wrote:

Good afternoon, all,

I want to be able to prevent users from viewing my code. I've already
disabled Alt-F11 using application.onkey, but they can still get to it by
right clicking the Excel logo on the Standard Menu Bar. Is there any way in
which I can reference this as an object, to either disable it or remove it
from the menu bar?

Thanks in advance

Pete