"Unable to get paste special property of the range class." is the error I get.
What am I missing?
Code: Select all
Data := Clipboard
Xl := ComObjCreate("Excel.Application")
Xl := ComObjActive("Excel.Application")
filepath = %A_WorkingDir%\new.xlsx
Xl.Workbooks.Open(filepath)
Xl.Visible := True
Clipboard := Data
; tried these ;
XL.Selection.PasteSpecial(-4163)
xl.Range("a1:D10").PasteSpecial(-4163)
XL.Selection.Range("a1:D10").PasteSpecial(-4163)
XL.Range("a1:D10").Selection.PasteSpecial(-4163)
XL.Selection.PasteSpecial(-4163).Range("a1:D10")
XL.Selection.Range("a1:D10") := XL.Selection.PasteSpecial(-4163)