Results 1 to 4 of 4
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Contents of RecordSet to Worksheet (XP & SAP)

    Anybody have experience importing data into Excel from SAP using a BAPI.

    I have this piece of code that sort of works, The problem is that when I tell it to dump the contents of the recordSet using CopyFromRecordset, I only get what looks like the last row in the record set.

    I added a
    Alan

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Contents of RecordSet to Worksheet (XP & SAP)

    Wow, what a great shortcut! I don't think Word can do this... Anyway, the VBA help for this says:

    "Copying begins at the current row of the Recordset object. After copying is completed, the EOF property of the Recordset object is True."

    So I would suspect that placing this just after ' Now dump... would do the trick:

    rstGETLIST.MoveFirst

    If it gives an error, make sure you don't have a ForwardOnly recordset.

  3. #3
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Contents of RecordSet to Worksheet (XP & SAP)

    THANKS A BUNCH! <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

    Who would imagine I would be tearing my hair out over one little word.
    Alan

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Contents of RecordSet to Worksheet (XP & SAP)

    For the sake of decorum, let's not use that little (four letter?) word in the Lounge. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

Posting Permissions

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