I want to copy a variable to the Clipboard and I have used this code in the past and it worked. Now it just returns ?? Any help would be appreciated.
Sub test()
'Microsoft Forms 2.0 Object Library is referenced
Dim MyData As DataObject
Dim strClip As String
strClip = Range("J" & ActiveCell.Row).Value
strClip = Left(strClip, Len(strClip) - 4)
MsgBox strClip 'At this point I get the expected result
Set MyData = New DataObject
MyData.SetText strClip
MyData.PutInClipboard
MsgBox strClip 'This returns ??
End Sub
Sub test()
'Microsoft Forms 2.0 Object Library is referenced
Dim MyData As DataObject
Dim strClip As String
strClip = Range("J" & ActiveCell.Row).Value
strClip = Left(strClip, Len(strClip) - 4)
MsgBox strClip 'At this point I get the expected result
Set MyData = New DataObject
MyData.SetText strClip
MyData.PutInClipboard
MsgBox strClip 'This returns ??
End Sub