Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Disable the Edit menu command 'Paste Special'

Is there a way to disable the Edit menu command "Paste
Special" while users opening and using a workbook I
supply? And then enable the command back again on exit?

I tried to do it by adding two events
Delete the command from the Edit menu with a Private Sub
Workbook-Open() event and Add the command back using the
Workbook-BeforeClose event. However, that is not very
useful because the user simply use the Customize option to
add 'Paste Special' back and use it. It defeats the
purpose.

Please help!

George

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Disable the Edit menu command 'Paste Special'

I'm not aware of a way to prevent users from customising their commandbars.
I don't think there is a way.


"George Raymond" wrote in message
...
Is there a way to disable the Edit menu command "Paste
Special" while users opening and using a workbook I
supply? And then enable the command back again on exit?

I tried to do it by adding two events
Delete the command from the Edit menu with a Private Sub
Workbook-Open() event and Add the command back using the
Workbook-BeforeClose event. However, that is not very
useful because the user simply use the Customize option to
add 'Paste Special' back and use it. It defeats the
purpose.

Please help!

George



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Disable the Edit menu command 'Paste Special'

you can set the protection property of acommandbar

Application.CommandBars("Worksheet Menu Bar").Protection =

here is a routine that shows the constants. You add them to get the
combination you want (basically they are setting the bits in a binary word).
The default value is 8. As an example
You probably want to at no customization to the Edit commandbar:

Application.CommandBars("Edit").Protection =

the default is 22 = 16 + 4 + 2

msoBarNoResize 2
msoBarNoMove 4
msoBarNoChangeDock 16

You probably want to add
msoBarNoCustomize 1

Sub tester2()
varr = Array("msoBarNoProtection ", _
"msoBarNoCustomize ", _
"msoBarNoResize ", _
"msoBarNoMove ", _
"msoBarNoChangeVisible", _
"msoBarNoChangeDock ", _
"msoBarNoVerticalDock ", _
"msoBarNoHorizontalDock")
varr1 = Array(msoBarNoProtection, _
msoBarNoCustomize, _
msoBarNoResize, _
msoBarNoMove, _
msoBarNoChangeVisible, _
msoBarNoChangeDock, _
msoBarNoVerticalDock, _
msoBarNoHorizontalDock)

For i = LBound(varr) To UBound(varr)
Debug.Print i, varr(i), varr1(i)
Next
End Sub

--
Regards,
Tom Ogilvy


George Raymond wrote in message
...
Is there a way to disable the Edit menu command "Paste
Special" while users opening and using a workbook I
supply? And then enable the command back again on exit?

I tried to do it by adding two events
Delete the command from the Edit menu with a Private Sub
Workbook-Open() event and Add the command back using the
Workbook-BeforeClose event. However, that is not very
useful because the user simply use the Customize option to
add 'Paste Special' back and use it. It defeats the
purpose.

Please help!

George



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Disable the Edit menu command 'Paste Special'

would you look at that! learn something new every day...


"Tom Ogilvy" wrote in message
...
you can set the protection property of acommandbar

Application.CommandBars("Worksheet Menu Bar").Protection =

here is a routine that shows the constants. You add them to get the
combination you want (basically they are setting the bits in a binary

word).
The default value is 8. As an example
You probably want to at no customization to the Edit commandbar:

Application.CommandBars("Edit").Protection =

the default is 22 = 16 + 4 + 2

msoBarNoResize 2
msoBarNoMove 4
msoBarNoChangeDock 16

You probably want to add
msoBarNoCustomize 1

Sub tester2()
varr = Array("msoBarNoProtection ", _
"msoBarNoCustomize ", _
"msoBarNoResize ", _
"msoBarNoMove ", _
"msoBarNoChangeVisible", _
"msoBarNoChangeDock ", _
"msoBarNoVerticalDock ", _
"msoBarNoHorizontalDock")
varr1 = Array(msoBarNoProtection, _
msoBarNoCustomize, _
msoBarNoResize, _
msoBarNoMove, _
msoBarNoChangeVisible, _
msoBarNoChangeDock, _
msoBarNoVerticalDock, _
msoBarNoHorizontalDock)

For i = LBound(varr) To UBound(varr)
Debug.Print i, varr(i), varr1(i)
Next
End Sub

--
Regards,
Tom Ogilvy


George Raymond wrote in message
...
Is there a way to disable the Edit menu command "Paste
Special" while users opening and using a workbook I
supply? And then enable the command back again on exit?

I tried to do it by adding two events
Delete the command from the Edit menu with a Private Sub
Workbook-Open() event and Add the command back using the
Workbook-BeforeClose event. However, that is not very
useful because the user simply use the Customize option to
add 'Paste Special' back and use it. It defeats the
purpose.

Please help!

George





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Disable the Edit menu command 'Paste Special'

Thank you Tom - That's great
George

-----Original Message-----
you can set the protection property of acommandbar

Application.CommandBars("Worksheet Menu Bar").Protection =

here is a routine that shows the constants. You add them

to get the
combination you want (basically they are setting the bits

in a binary word).
The default value is 8. As an example
You probably want to at no customization to the Edit

commandbar:

Application.CommandBars("Edit").Protection =

the default is 22 = 16 + 4 + 2

msoBarNoResize 2
msoBarNoMove 4
msoBarNoChangeDock 16

You probably want to add
msoBarNoCustomize 1

Sub tester2()
varr = Array("msoBarNoProtection ", _
"msoBarNoCustomize ", _
"msoBarNoResize ", _
"msoBarNoMove ", _
"msoBarNoChangeVisible", _
"msoBarNoChangeDock ", _
"msoBarNoVerticalDock ", _
"msoBarNoHorizontalDock")
varr1 = Array(msoBarNoProtection, _
msoBarNoCustomize, _
msoBarNoResize, _
msoBarNoMove, _
msoBarNoChangeVisible, _
msoBarNoChangeDock, _
msoBarNoVerticalDock, _
msoBarNoHorizontalDock)

For i = LBound(varr) To UBound(varr)
Debug.Print i, varr(i), varr1(i)
Next
End Sub

--
Regards,
Tom Ogilvy


George Raymond

wrote in message
...
Is there a way to disable the Edit menu command "Paste
Special" while users opening and using a workbook I
supply? And then enable the command back again on exit?

I tried to do it by adding two events
Delete the command from the Edit menu with a Private Sub
Workbook-Open() event and Add the command back using the
Workbook-BeforeClose event. However, that is not very
useful because the user simply use the Customize option

to
add 'Paste Special' back and use it. It defeats the
purpose.

Please help!

George



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GO TO SPECIAL (WITHIN EDIT MENU IN 2003) ORLY Excel Discussion (Misc queries) 2 January 12th 09 06:14 AM
copy command is disable under edit menu Anirban Dutta Excel Discussion (Misc queries) 2 March 22nd 07 10:56 AM
how to disable copy paste buttons from from edit menu excel test Excel Discussion (Misc queries) 2 January 18th 07 05:00 PM
How disable menu command Armangelo Excel Discussion (Misc queries) 0 February 1st 06 10:00 AM
Disable Menu and command buttons Tom Ogilvy Excel Programming 0 July 14th 03 01:55 PM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"