Have a look at this:
https://stackoverflow.com/a/14226925/8716187
Dim DataObj As New MSForms.DataObject
'Put a string in the clipboard
DataObj.SetText Thisworkbook.Worksheet("Sheet1").TextBox1.Text 'name of your textbox here
DataObj.PutInClipboard
'Get a string from the clipboard
DataObj.GetFromClipboard
Debug.Print DataObj.GetText
** Tested and working, no scope problems here though as Textbox, Control Button, Worksheet Code all in the same scope - you may need to describe the location of your objects
-WWC
I tested your version, it also worked, be sure your TextBox1 is what you think it is. How is it created, if at runtime it may not the the number (name) you think it is.
This also compiles and runs without error:
Private Sub CommandButton1_Click()
With New MSForms.DataObject
'Put a string in the clipboard
.SetText TextBox1.Text 'name of your textbox here
.PutInClipboard
'Get a string from the clipboard
.GetFromClipboard
Debug.Print .GetText
End With
End Sub