generali
asked on
Clipboard...
Is there any way to detect what text is currently on the clipboard through some code in VBA?
Cheers
Matt
Cheers
Matt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get the following error:
Dataobject:GetText Invalid FORMATETC structure
I am actually using code specific to an external application to copy the text, does this make any difference?
And I used:
If MyDataObj.GetText() = "" Then
GoTo MOD1RESUME
Else
Sheets("DataGather").Selec t
-------------------------- -
I can use "" cant I??
Dataobject:GetText Invalid FORMATETC structure
I am actually using code specific to an external application to copy the text, does this make any difference?
And I used:
If MyDataObj.GetText() = "" Then
GoTo MOD1RESUME
Else
Sheets("DataGather").Selec
--------------------------
I can use "" cant I??
the clipboard content has to be in text format. try this
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
If MyDataObj.GetFormat(1) = True Then
MsgBox MyDataObj.GetText()
Else
MsgBox "Clipboard empty or Data in clipboard in not in text format"
End If
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
If MyDataObj.GetFormat(1) = True Then
MsgBox MyDataObj.GetText()
Else
MsgBox "Clipboard empty or Data in clipboard in not in text format"
End If
ASKER
Cheers again Rajesh, and thankyou OM !
Matt
Matt
thanks for the grade, Matt(generali)
could i ask you what OM stands for??
could i ask you what OM stands for??
ASKER
No probs rajesh, yeah OM stands for other Matt !
:) Thanks!
lol, spent almost 5mins thinking of all combinations. wasn't even close :)
Heh, ohso much, old man, on me
Congrats on the wizard cert by the way! I'll officially congratulate you when an official congratulations thread shows up (I'd start one now but I have to run for a couple hours).
Cheers!
Congrats on the wizard cert by the way! I'll officially congratulate you when an official congratulations thread shows up (I'd start one now but I have to run for a couple hours).
Cheers!
thanks Matt, I appreciate it.
still working hours at your end i believe :(
its bed for me... :)
still working hours at your end i believe :(
its bed for me... :)
I wondered why the GetFromClipboard method worked in my Personal.xls and not in other Modules. It was due to the missing references. That is very helpful.
Thanks!
Jaes