Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel clipboard 1

Status
Not open for further replies.

wuxapian

Programmer
Jun 13, 2001
52
GB
Hi all,

I need to get Excel to read data in from the clipboard. I have placed data on the clipboard from a VB application and I need an excel file (using vba) to copy the data from the clipboard to a variable before it is output to the cells.

Does anyone have any examples of this or point me in the right direction?

Thanks
Wuxapian...
 
Hi,

Read the help on GetFromClipboard Method
There are various methods to get data from the dataobject

First I copied some text in Word.
Code:
Sub GetDataFromClipboard()
    Dim MyData As DataObject
    
    Set MyData = New DataObject
    
    MyData.GetFromClipboard
    MsgBox MyData.GetText(1)
End Sub
Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top