Skip to Content
avatar image
Former Member

How can I execute 6 sessions in parallel?


I've been working on this for a couple of weeks. I've searched the internet (including 😊), asked people and have come up empty.

this site/discussion area has been a great help, but I can't find a way to execute multiple sessions at once.

here's the scenario.

I have 6 custom reports that I run daily that take 30 minutes to run serially. If I run multiple sessions in parallel, It takes 5 to 10 minutes.

Using excel/VBA, I have connected to SAP, started 6 sessions (session.createsession), each session navigates to its custom report screen, set variant and now want to run them at the same time/in parallel/asynchronous/concurrently...

I've tried "SendVKey 8" and .Press (execute button), but they execute one at a time instead of all at once.

Here's a test with 2 sessions. control isn't returned each step is complete.

With SAPConnObj

.Children(0).FindById("wnd[0]").Restore 'make active

.Children(0).FindById("wnd[0]").SendVKey 8


.Children(3).FindById("wnd[0]").Restore 'make active

.Children(3).FindById("wnd[0]").SendVKey 8


End With

I can't believe I'm the only one that wants to do this.

If I can't run them in parallel, can I run them in the background?

that may accomplish the same thing.

Any help/code would be appreciated.



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jul 14, 2013 at 07:16 AM

    Hello Steve,

    as far as I know is VBA single threaded and it is not possible to run multiple threads or processes.

    I think one way is to code six different VBScript files with your code. Start each from Excel with the VBA command Shell, here an example:

    Shell "wscript.exe MyScript1.vbs"

    Shell "wscript.exe MyScript2.vbs"

    etc. etc. etc.

    Let us know if it works.



    Add comment
    10|10000 characters needed characters exceeded