Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAP GUI Scripting "Invalid use of property" Error in VBA

Tags:

vba

sap-gui

Hello I am using SAP GUI Scripting tool which uses Excel VBA functionality to complete the task. I am getting Invalid use of property at Set Application = SapGuiAuto.GetScriptingEngine line of code:

If Not IsObject(Application) Then
   Set SapGuiAuto = GetObject("SAPGUI")
   Set Application = SapGuiAuto.GetScriptingEngine

Why do I get this error?

like image 764
user SG Avatar asked Jan 22 '26 16:01

user SG


1 Answers

I suggest you to rename the variable Application to another name.

Application is here used like a variable, but it is also a pre-defined read-only object in Excel.

like image 67
SQL Police Avatar answered Jan 25 '26 13:01

SQL Police



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!