How to Paste clipboard data to Excel

mdnaveed2

New Member
Hi,

I am trying to paste data from clipboard to excel with . When I use keyboard shortcuts the data is getting paste accurately and Can anybody help me on how to use GLOBAL send keys on Excel or if any other option to get the data from clipboard to excel?

Thank you,
Nav
 

mdnaveed2

New Member
Hi rsingh40,

Thank you for your reply!

I don't know about the coding, however I tried to edit the code from your above thread as below

Dim sw, dw As Object
Dim ss, ds As Object
Dim excel, sheet As Object


Try
sw = GetWorkbook(Handle, Source_Workbook)
ss = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)


sw.Activate()
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet

sheet.Range("A2").Paste


Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
sw = Nothing
ss = Nothing
excel = Nothing
sheet = Nothing
End Try

Its not working, not able to paste the data from clipboard.

Thank you
 
Top