Use try
-catch
, even if it has an error it will still copy.
Try
Clipboard.SetText("copy me to clipboard")
Catch ex As Exception
End Try
If you use a message box to capture the exception, it will show you error, but the value is still copied to clipboard.