LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ned ned is offline
external usenet poster
 
Posts: 5
Default Worksheet_SelectionChange clears clipboard - can I stop this?

Hi all;

I have a Worksheet_SelectionChange event that sets the calculation mode.
When it runs the clipboard gets cleared, making it impossible to copy from
cell to cell. I tried using the DataObject to get the contents of the
clipboard and then restore them, but that generates a not-implemented error.
I have the required references etc. Is it possible to determine if cells
have been copied, and restore the clipboard with the same data at the end of
the Worksheet_SelectionChange event code?

Here's what I have now:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
If Not (Intersect(Target.Cells(1, 1), Me.[LamTable]) Is Nothing) Then
Application.Calculation = xlCalculationManual
ElseIf [gCalc] = True Then
Application.Calculation = xlCalculationAutomatic
End If
MyDataObj.PutInClipboard 'ERROR here
End Sub

PS I have to do this because my Worksheet_Change event fails when a cell
with data validation is changed and the calculation mode is automatic. I
tried in vain to fix that, but it appears that the fact that my own
worksheet functions are affected makes it impossible. This hack works, but
the clipboard gets clobbered.

Thanks,

Stephen

__________________________________________________ __________________________
____
S. Fitzgerald, P.Eng, MASc.
Halifax, NS
Canada



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
launching Excel clears clipboard Richard Excel Discussion (Misc queries) 0 July 17th 08 01:51 PM
Strange behaviour - loading Excel clears Clipboard Trevor Shuttleworth Excel Discussion (Misc queries) 1 August 19th 06 10:04 PM
How do I make the clipboard stop automatically popping up? D Excel Discussion (Misc queries) 1 April 27th 06 05:01 PM
Worksheet_SelectionChange Bill Oertell[_2_] Excel Programming 8 April 23rd 04 05:18 AM
Really Need Help: side effect clears clipboard!!! Bura Tino Excel Programming 3 February 28th 04 12:44 PM


All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"