Question : 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
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
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

Answer : Excel Automation Paste

oExcel.ActiveSheet.Paste

If you assign
oas = oExcel.ActiveSheet

then you should see intellisense help after typing   oas.
Random Solutions  
 
programming4us programming4us