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 DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub
3. Public Declare Function OpenClipboard Lib "user32" ( _
ByVal hwnd AsLong) As Long
Public Declare Function CloseClipboard Lib "user32" () As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Sub ClearClipboard()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Sub
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 DataObject
doFName.SetText ""
doFName.PutInClipboard ' clears clipboard
Does anyone have a verifed solution for Excel 2000 running on a Windows 2000 machine?
The problem with solution #2 is that you need a reference to the
MSForms type library. In VBA, go to the Tools menu, choose
References, and choose "Microsoft Forms 2.0 Object Library".
Solution #3 works in all version of Excel and Windows. Just call
the ClearClipboard function.
Solution #4 doesn't work in VBA because VBA doesn't have a
Clipboard object like VB6 does.
The problem in solution #5 is the same as in #2: you need a
reference to the MSForms type library.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Steve" <anon...@discussions.microsoft.com> wrote in message
news:0A9C8BFA-5E36-4264...@microsoft.com...
---
Message posted from http://www.ExcelForum.com/