Stumbleupon Facebook Twitter Digg Google Delicious Linkedin
TechNews

Activate & Deactivate Clipboard worksheet compensation

Posted: 27 Jan 2012

Tags: Activate amp Deactivate Clipboard worksheet compensation Activate amp Deactivate Clipboard worksheet compensation


Activate & Deactivate Clipboard worksheet compensation

Source: www.thebest3d.com

Question:

I have a two routines that when the worksheet is enabled or disabled will clear the contents of the Clipboard. This is exactly what I do not want. The problem is that this does not make a difference on the actual commands in the routine. I have one by one, commented and delete commands. If any of the commented lines are uncommented, the Clipboard is cleared. I can put in x = 1 and that disable the Clipboard. I have searched all CellDragAndDrop project and all the = true. I have some of them have rather false, but he thought that it might be the problem by an invisible link between the routines. I even deleted all "ThisWorkbook" Excel object, and it is still based on having commented lines below without comment.

Private Sub Worksheet_Activate()
' Application.CellDragAndDrop = True
' ActiveWindow.DisplayGridlines = False
' ActiveWindow.DisplayZeros = True
End Sub

Private Sub Worksheet_Deactivate()
' Application.CellDragAndDrop = True
""Application.OnKey"^ v"
End Sub

Brad
Excel XP-2010
Windows XP 32-7 (64)

Answer:

Almost everything you do in the code that modifies the interface will clear the Clipboard. When it can only change what needs to change. Perhaps change your code like this

With ActiveWindow
SI.DisplayGridlines then.DisplayGridlines = False
Sinon.DisplayZeros then.DisplayZeros = True
End with

This should help preserve the Clipboard where nothing did need to be changed, which I suspect with this special code will be most of the time the event is raised.

Faisant.CellDragAndDrop = True does help better not to try.

Peter Thornton

Rate this article:


  • Pages:
  • 1

0 Comments

Add Your Comment !