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
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,113)