cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JAWL
Super User
Super User

SAP VBScript error while running in PAD

Dear Power Automate Desktop Experts, I encountered an error when I'm trying to run a very simple VBScript in Power Automate Desktop:
C:\Users\WAng26\AppData\Local\Temp\Robin\nx5bq0v00fa.tmp(2, 1) (null): Invalid syntax
 
The exact same VBScript can run perfectly when I execute the .vbs file. The VBScript is per below:
 
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]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nLT24"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtT2_LGNUM").text = "140"
session.findById("wnd[0]/usr/ctxtT2_MATNR-LOW").text = "*"
session.findById("wnd[0]/usr/ctxtT2_MATNR-LOW").setFocus
session.findById("wnd[0]/usr/ctxtT2_MATNR-LOW").caretPosition = 1
 
Immediate help is much appreciated.
2 REPLIES 2
fraenK
Memorable Member
Memorable Member

Hi @fraenK the "bug" (derived from PAD update) was fixed after I restarted my laptop. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,659)