I am using Run Script command to run a vb script. The script runs fine when executed directly but doesn't even execute the first line of the script when called from the Run Script Command.
The script is for SAP GUI but this is not the only instance where this error comes up. I will attach the script for the reference.
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
If Not IsObject(connection) Then
Set connection = application.Children(0)
If Not IsObject(session) Then
Set session = connection.Children(0)
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
session.findById(wnd/usr/cntlCONTAINER/shellcont/shell).focusDate = "20220110"
Hi @Rishav Pandey ,
Could you try omitting the first line of code and see if the script works?
Hi @Ashwin A.K
I removed that line and tried it.. Result is same.
Even tried a blank script. Still the same
Run Script command does not show you in which line the issue is, which you'd need to identify by using the MessageBox command to debug the exact line causing this issue.
Also, check the elevation mode of AA and SAP. I've seen SAP opening with Admin: yes while the AAPlayer opens with default Admin: no.