thread707-1380005
I used the code in the above thread and it gives me a message box showing the data stored in memory. However, I want to paste the data and I am having problems.
I tried using ActiveCell.Value = MyData.GetText(1) as well as ActiveCell.Value = Selection but I am getting all the data into one cell with ctrl breaks instead of pasting the data in multiple cells
Please help!
I used the code in the above thread and it gives me a message box showing the data stored in memory. However, I want to paste the data and I am having problems.
I tried using ActiveCell.Value = MyData.GetText(1) as well as ActiveCell.Value = Selection but I am getting all the data into one cell with ctrl breaks instead of pasting the data in multiple cells
Please help!
Code:
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Sub Clear_Clipboard()
OpenClipboard (0)
EmptyClipboard
CloseClipboard
End Sub
Sub myFunc()
Set MyData = New DataObject
MyData.GetFromClipboard
On Error GoTo ERRHANDLER
strClip = MyData.GetText(1)
MyData.SetText strClip
MyData.PutInClipboard
MsgBox MyData.GetText
'Cpy.GetFromClipboard
Selection = MyData.GetText(1)
'this is where I want to paste the data, but not getting the result
ActiveCell.Value = Selection
Application.CutCopyMode = False
Exit Sub
ERRHANDLER:
MsgBox "Empty Clipboard"
End Sub