3

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?

3
  • Not sure, but if Application is not an object, you can't use the Set keywaord for assignment. Commented Mar 19, 2016 at 10:23
  • How is Application declared? If this is running in Excel VBA then VBA is going to interpret Application, with no declaration, as the Excel application. That would certainly not be correct. Beyond that, is the sytax on the right side of the equation correct? GetScriptingEngine sounds like a method, what does it return? Does it return, or is it expecting a ByRef parameter? You're also missing relevant tags that would make this visible to people who know something about the SAP Scripting tool... Commented Mar 19, 2016 at 11:59
  • Thanks . The issue was resolved by renaming the variable Application as Sapplication. Commented Mar 20, 2016 at 19:26

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes the issue was resolved by renaming the Application variable in the code as Sapplication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.