+ Reply to Thread
Results 1 to 5 of 5

Copy and Paste in active sheet VBA code

  1. #1
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    149

    Copy and Paste in active sheet VBA code

    I am copying this from SAP

    .findById("wnd[2]/usr/lbl[5,2]").setFocus
    .findById("wnd[2]/usr/lbl[5,2]").caretPosition = 2

    I need paste this in active sheet

    xclsht.Cells(1,1).Value = .findById("wnd[2]/usr/lbl[5,1]").text
    xclsht.Cells(1,2).Value = .findByID("wnd[2]/usr/lbl[5,2]").text


    I would like to paste in active sheet (sheet1) cell 1 and 2 respectively. But I am getting error. sheet name is SAP1.xlsx

    Pls help, any help will be appreciate!!!
    Attached Images Attached Images
    Last edited by raw_geek; 05-09-2014 at 04:40 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Copy and Paste in active sheet VBA code

    What error
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    149

    Re: Copy and Paste in active sheet VBA code

    Thanks for looking, the error i am getting
    Run -time '619' application-defined or object-defined error
    . please see the attachment

    Thanks !
    Attached Images Attached Images

  4. #4
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    149

    Re: Copy and Paste in active sheet VBA code

    any help please??

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Copy and Paste in active sheet VBA code

    Well, for me still not enough data.
    Even no highlighted line where code stops.

    Could be, that you try to do something with other sheet then you think you do
    - first screenshot shows activating one sheet and writing to another.
    Is this second assigned, etc. Who knows?

  6. #6
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    149

    Re: Copy and Paste in active sheet VBA code

    thank u for ur help , i found the error myself.

    .findById("wnd[2]/usr/lbl[5,2]").setFocus
    .findById("wnd[2]/usr/lbl[5,2]").caretPosition = 2

    xclsht.Cells(1,1).Value = .findById("wnd[2]/usr/lbl[5,1]").text - this should be 5,2
    xclsht.Cells(1,2).Value = .findByID("wnd[2]/usr/lbl[5,2]").text

    Thanks all

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Copy from one sheet and paste two cells to the right from active cell on another sheet
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2013, 01:16 PM
  2. Copy Cell Range From Previous Sheet and Paste to Active Sheet
    By jtal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2013, 03:26 PM
  3. [SOLVED] How to paste from other sheet to active cell VBA code
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2013, 02:49 AM
  4. Replies: 1
    Last Post: 01-07-2013, 12:23 AM
  5. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1