user SG
user SG

Reputation: 33

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

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?

Upvotes: 3

Views: 5771

Answers (1)

SQL Police
SQL Police

Reputation: 4196

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.

Upvotes: 3

Related Questions