RobBroekhuis
Technical User
I have an Excel event handler routine (SheetChange) that uses copy, and therefore overwrites the clipboard. I'm trying to save and restore the clipboard, so that this is transparent to the user, using the following code:
I get no errors, and at the end of the event the "Paste" option is available on the Edit menu, but when I try to use it, Excel tells me it can't paste the data. I was able to get the concept to work while playing around in direct mode, with both single-cell and multi-cell selections. What's wrong with the code above?
Thanks
Rob
Code:
dim ClipSave as DataObject
[in Workbook_Open:]
set ClipSave = new DataObject
Private Sub SaveClipBoard()
If Application.CutCopyMode > 0 Then
ClipSave.GetFromClipboard
End If
End Sub
Private Sub RestoreClipBoard()
ClipSave.PutInClipboard
ClipSave.Clear
End Sub
Thanks
Rob