Link to home
Start Free TrialLog in
Avatar of jaymz69
jaymz69

asked on

Excel Automation Paste

I have it down to where I open one sheet select the cells an copy

next open another sheet and slect cells and PASTE,
BUT I get the OLE Error of Unknown Name, 0x080020006

on the last line of code: oExcel.ActiveSheet.Past

I have down the macro and referenced other articles but I keep error on the past part for some reason...

Thanks
oExcel = CREATEOBJECT("Excel.Application")
oExcel.Visible = .T.
oWorkBookT = oExcel.WorkBooks.Open("C:\AdminErrorCheck\Templates\family_headers.xls")
oRangeT = oExcel.ActiveSheet.Range("A1:DG1").Select
oExcel.Selection.Copy

*Activate and copy to the final report
oWorkBookF = oExcel.WorkBooks.Open("c:\marketing_target_ALL_customers.xls")
oExcel.Visible = .T.
oRangeF = oExcel.ActiveSheet.Range("A1:DG1").Select
oExcel.ActiveSheet.Past

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial