cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JAWL
Helper V
Helper V

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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,839)