1
Hello, I have a simple spreadsheet (3 cols and 2 Rows) and am trying to create a script to open it, copy your data and insert into another.
Path = "C:\Users\user_name\Documents\excell\planilha1.xlsx"
Set objexl = CreateObject("Excel.application")
objexl.Visible = True
Set objwkb = objexl.Workbooks.Open(Path)
Set objsht = objwkb.Sheets(1)
objsht.Range("A2").Select
objsht.Range(Selection.End(xlToRight), Selection.End(xlDown)).Select
Selection.Copy
when executed, the spreadsheet opens and the following error is returned: Objeto necessário: 'Selection'
, and the error occurs on line 7. Someone could give me a light?
thank you very much, it worked out, the funny thing is that I swear I had tried to make this solution that you gave me kkk
– Jefter Rocha