View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stt_d31[_2_] stt_d31[_2_] is offline
external usenet poster
 
Posts: 1
Default problem: when paste = validations lost = excel corrupted !


i found this already and it works fine, but I'm more looking for the
following:
- set "paste values" by default instead of normal paste?
- disallow normal paste, but allow "paste values".
- when user does ctrl V: excel does automatically "paste values"?


Code:
--------------------


Private Sub CommandButton1_Click()
' Add this code in the Workbook_Activate event
' it will load every time the workbook is activated

' Turn off the menu
Application.CommandBars("Edit").Controls(3).Enable d = False
Application.CommandBars("Edit").Controls(4).Enable d = False 'copy
Application.CommandBars("Edit").Controls(5).Enable d = False
Application.CommandBars("Edit").Controls(6).Enable d = False
' Turn off the toolbar:
Application.CommandBars("Standard").Controls(7).En abled = False
Application.CommandBars("Standard").Controls(8).En abled = False
'Application.CommandBars("Standard").Controls(9).E nabled = False 'copy
Application.CommandBars("Standard").Controls(10).E nabled = False
' turn off shortcutkeys:
'Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "^x", ""
End Sub

Private Sub CommandButton2_Click()
' Add this code in the Workbook_Activate event
' it will load every time the workbook is de-activated

' Enable the menu:
Application.CommandBars("Edit").Controls(3).Enable d = True
Application.CommandBars("Edit").Controls(4).Enable d = True
Application.CommandBars("Edit").Controls(5).Enable d = True
Application.CommandBars("Edit").Controls(6).Enable d = True
' Enable the commandbar:
Application.CommandBars("Standard").Controls(7).En abled = True
Application.CommandBars("Standard").Controls(8).En abled = True
Application.CommandBars("Standard").Controls(9).En abled = True
Application.CommandBars("Standard").Controls(10).E nabled = True
' Enable the shortcut keys:
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "^x"
End Sub


--------------------


--
stt_d31
------------------------------------------------------------------------
stt_d31's Profile: http://www.excelforum.com/member.php...o&userid=24040
View this thread: http://www.excelforum.com/showthread...hreadid=376492