View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Graham H Graham H is offline
external usenet poster
 
Posts: 56
Default Paste unavailable

Thanks for help. There is only one worksheet with code but others are affected. The only
code in the workbook module is as below and I cannot spot anything that would cause it but
my knowledge is limited. Please don't waste time on it but if anyone sees anything
obvious I would appreciate it being pointed out.

Graham

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
strLastSheet = Sh.Name
End Sub




Private Sub Workbook_Open()
Dim NewControl As CommandBarControl
' Assign shortcut to display calendar on SHIFT+CTRL+C
Application.OnKey "+^{C}", "Module1.OpenCalendar"
' Add item to shortcut menu on open
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
On Error GoTo 0
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
.Move befo=1
End With
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Delete item from shortcut menu on close
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
End Sub



Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayZeros = False
ActiveSheet.DisplayAutomaticPageBreaks = False
End Sub


Jim Rech wrote:
You may have code running that has the unintended side-effect of clearing
the clipboard. Sheet activate or deactivate event code most likely or
that's my guess. The code is probably in the workbook in question but it
could be in another workbook or in an add-in. To look in the current
workbook right click the sheet's tab and pick View Code. If there is no
code look in the target sheet's code or the ThisWorkbook module.