Paste unavailable

G

Graham H

An annoying problem seems to have developed in a workbook (Excel 2002)I have and I am not
sure how I arrived at it or how to sort it. I now cannot seem able to paste any data
between worksheets. If I copy form a worksheet it goes into the clipboard. When I move to
another worksheet and try to paste it, the paste option is greyed out and CTRL-V doesn't
work either. I have no problems with any other workbooks,only the one but it is a bit of a
pest. Any suggestions would be most welcome.

Graham
 
J

Jim Rech

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.
 
G

Graham H

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 before:=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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top