View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
steve steve is offline
external usenet poster
 
Posts: 141
Default Clear Clipboard in VB

In Windows Excel 2000, I am trying to clear the clipboard using commands in a macro, but have not found a solution. I have tried the following suggestions from other postings, but these have not worked. The ones that I have tried are

1. Application.CutCopyMode = False (Maybe works in the XP version

2. Public Sub ClearClipboard() (Compiler does not like the DataObject definition
Dim MyDataObj As New DataObjec
MyDataObj.SetText "
MyDataObj.PutInClipboar
End Su

3. Public Declare Function OpenClipboard Lib "user32" (
ByVal hwnd AsLong) As Lon
Public Declare Function CloseClipboard Lib "user32" () As Lon
Public Declare Function EmptyClipboard Lib "user32" () As Lon

Sub ClearClipboard(
OpenClipboard (0&
EmptyClipboar
CloseClipboar
End Su

Put declarations in a General module

4. Clipboard.clear (Compiler does not like this command.

5. Dim doFName As MSForms.DataObject (Compiler does not like the DataObject definition

Set doFName = New DataObjec

doFName.SetText "

doFName.PutInClipboard ' clears clipboar

Does anyone have a verifed solution for Excel 2000 running on a Windows 2000 machine