I want to copy text to the Windows 10 clipboard ready for pasting with Ctrl+V into an appropriate external application.
I found a promising answer I cannot get working: Copy Variable's Contents to Clipboard VBA (Excel 2013)
My simplified test code:
Sub TestCopyTextToVar()
Dim myData As DataObject
Dim Output As String
Output = "abc"
Set myData = New DataObject
myData.SetText Output
myData.PutInClipboard
MsgBox (Output & " Text has been copied")
End Sub
MsgBox displays Output correctly as 'abc'.
A paste into Notepad (or other apps, such as the intended application) displays nothing.
TextPad displays two question marks '??'.
SetText. Method. See here - JvdV