Putting a variable value into the Clipboard
Hi Greg,
' DataObject requires as reference in Tools/References to
' Microsoft Forms 2.0 Object Library
' This is added automatically if a Userform has ever existed
' in the project. So, quick way is to add/remove a Userform.
'
Sub test()
Dim dob As DataObject
Set dob = New DataObject
dob.SetText "abc"
dob.PutInClipboard
' now paste into any application
End Sub
Not sure why you write this -
This method is not available for a text variable
Quite the contrary, the DataObject can ONLY accept text
Regards,
Peter T
"Greg de Bruin" wrote in message
...
I have an Excel macro that reads from several cells and builds them into a
variable. I then want to paste the value of the variable into the
Clipboard
so it can be pasted into a text box of another application.
I saw an example in Help that used a DataObject and then used the
PutInClipboard method. This method is not available for a text variable.
What do I have to do to get my text variable into a DataObject. I don't
even know what a DataObject is.
Thanks,
Greg
|