I have a workbook (Excel 2007 .xlsm) that I want to be able to copy information from other workbooks and paste into here. It worked fine, but in order to disable the cut function I had to paste code in there (shown below) and now the right click paste option and the paste button are disabled after I click "copy" from the other workbook. There's nothing in the code that would have disabled the paste function, but when I disable macros to take the code out of play it works again. The worksheets are all locked (except for the user input cells to which I need to paste) and in order to make the below programming worked, I unprotected the workbook to allow the code to run. Any remedies or workarounds to get re-enable pasting from other documents into here?
IN THIS WORKBOOK
Private Sub Workbook_Open()
Run "myMenu"
End Sub
Private Sub Workbook_Activate()
Run "myMenu"
End Sub
Private Sub Workbook_Deactivate()
Run "myReset"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Run "myReset"
End Sub
IN MODULE
Private Sub myMenu()
With Application
.OnKey "^x", ""
.CellDragAndDrop = False
Dim obtn As CommandBarButton
With .CommandBars("Cell")
Set obtn = .FindControl(ID:=21)
obtn.Enabled = False
End With
End With
End Sub
Private Sub myReset()
With Application
.OnKey "^x"
.CellDragAndDrop = True
.CommandBars("Cell").Reset
End With
End Sub
Bookmarks