Skip to Content
avatar image
Former Member

VBS Script error while running from desktop.

Hello ,

i am making simple VBS Script as follow

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]/tbar[0]/okcd").text = "/nSt22"

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

while running the same by double clicking from desktop, it throws below error. while it runs fine with scripting recording functionality from GUI itself.

any help is appriciated.



script-error.png (10.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers