+ Reply to Thread
Results 1 to 1 of 1

Disable Cut and Paste from Home Toolbar

Hybrid View

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Disable Cut and Paste from Home Toolbar

    Hello,

    I have been searching the net on how to disable Cut, copy and Paste in Excel. I have come across this code and it is working all right.
    But this only works for drag and drop, right-click and pressing the Ctrl button on the keyboard. What I need to know is how I can disable the cut, copy and paste in the Home Toolbar. I am using Excel 2007.

    Thanks!

    Private Sub Workbook_Activate()
    Application.CutCopyMode = False
    Application.OnKey "^c", ""
    Application.CellDragAndDrop = False
    End Sub

    Private Sub Workbook_Deactivate()
    Application.CellDragAndDrop = True
    Application.OnKey "^c"
    Application.CutCopyMode = False
    End Sub

    Private Sub Workbook_WindowActivate(ByVal Wn As Window)
    Application.CutCopyMode = False
    Application.OnKey "^c", ""
    Application.CellDragAndDrop = False
    End Sub

    Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
    Application.CellDragAndDrop = True
    Application.OnKey "^c"
    Application.CutCopyMode = False
    End Sub

    Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    MsgBox "Right click menu deactivated." & vbCrLf & _
    "Cannot copy or ''drag & drop''.", 16, "For this workbook:"
    End Sub

    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Application.CutCopyMode = False
    End Sub

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    Application.OnKey "^c", ""
    Application.CellDragAndDrop = False
    Application.CutCopyMode = False
    End Sub

    Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
    Application.CutCopyMode = False
    End Sub
    Last edited by allansy8; 04-23-2014 at 09:15 AM. Reason: missing word

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2013, 10:20 AM
  2. Replies: 0
    Last Post: 08-15-2012, 08:13 AM
  3. Enable/disable copy paste (disable part not working)
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 07:23 PM
  4. Replies: 2
    Last Post: 05-04-2006, 04:10 PM
  5. [SOLVED] Disable toolbar drop down
    By BobbyS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2006, 06:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1