I am trying to see if there is anything in the clipboard. The below code works when there is something in the clipboard but, if there is nothing I get a run time error on the bolded blue line of:
run time error'-2147221404(80040064)':
DataObject:GetText Invalid FORMATETC structure
Why is this and how can I change this so it won't blow up?
____________________________________
Dim MyData As New DataObject
Dim strClip As Variant
MyData.GetFromClipboard
strClip = MyData.GetText
If Not (IsNull(strClip)) Then
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End If
___________________________________________
Thanks in advance!!
run time error'-2147221404(80040064)':
DataObject:GetText Invalid FORMATETC structure
Why is this and how can I change this so it won't blow up?
____________________________________
Dim MyData As New DataObject
Dim strClip As Variant
MyData.GetFromClipboard
strClip = MyData.GetText
If Not (IsNull(strClip)) Then
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End If
___________________________________________
Thanks in advance!!