cancel
Showing results for 
Search instead for 
Did you mean: 

VBS Script recording with Pause

Former Member
0 Kudos

Dear Gurus,

I have managed to have SAP create a VBS script with the Record and Playback function. I am using it for my Picking Progress (TC LT45) Also I can run it without problems. However, I am looking for a Pause / Wait function after the F8

There seem to be a number of options to build in a Pause. I have not managed to make it work. Is there a way? XThanks for your input.

Nick

If Not IsObject(application) Then

   Set SapGuiAuto  = GetObject("SAPGUI")

   Set application = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(connection) Then

   Set connection = application.Children(0)

End If

If Not IsObject(session) Then

   Set session    = connection.Children(0)

End If

If IsObject(WScript) Then

   WScript.ConnectObject session,     "on"

   WScript.ConnectObject application, "on"

End If

session.findById("wnd[0]").resizeWorkingPane 263,47,false

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I use the following in my scripts to pause the script:

Set Wshell = CreateObject("WScript.Shell")
wscript.sleep100

You can change the milliseconds from 100 to whatever works best for you.

Regards

Umur