View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] rlaemmler@gmail.com is offline
external usenet poster
 
Posts: 16
Default ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard?

Hi,

I have following code in my workbook:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Call Excel.ActiveSheet.UsedRange.ClearContents
Call Excel.ActiveSheet.UsedRange.ClearFormats
Excel.ActiveSheet.Cells(1, 1).Value = "test"
End Sub

When I copy a value from Sheet1 and try to Paste it on Sheet2 the paste
doesn't work. For some reason both ClearContents and ClearFormats clear
the clipboard as well.

Does anybody know a workaround for this so that the clipboard is still
available?

Thx,
Reto