Excel Automation Paste

Posted on 2010-01-08
Last Modified: 2012-05-08
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...

oExcel = CREATEOBJECT("Excel.Application")

oExcel.Visible = .T.

oWorkBookT = oExcel.WorkBooks.Open("C:\AdminErrorCheck\Templates\family_headers.xls")

oRangeT = oExcel.ActiveSheet.Range("A1:DG1").Select


*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


Open in new window

Question by:jaymz69
    1 Comment
    LVL 41

    Accepted Solution


    If you assign
    oas = oExcel.ActiveSheet

    then you should see intellisense help after typing   oas.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: (http://msd…
    David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now