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.