0

I have the following error in a VBA function.

It says this is an invalid syntax here:

Set SapGuiAuto = GetObject("SAPGUI")

Do I need any reference for this? I have SAP GUI 7.30.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
bucurvlad
  • 119
  • 3
  • 15
  • What version of office do you use? ..bits and 20.. ? Take a look here : http://scn.sap.com/message/13876230#13876230 – R3uK Aug 04 '15 at 09:02
  • I'm having the same issue. The problem is that when I run through windows cmd or manually double-click the .vbs file, it works great. However, running from groovy (java) I get the error. I'm really lost on this issue. – brunoazev Oct 11 '19 at 20:03

2 Answers2

1

I had the same problem. What is happening is that it is trying to get a handle on an existing COM object (GetObject) instead of creating one (CreateObject).

The solution was as simple as having a running SAP GUI instance before launching the script.

mydoghasworms
  • 18,233
  • 11
  • 61
  • 95
0

I believe SAPGUI scripting should work with Office 2013 - I assume you've reviewed the sample applications in note 1441550? Scripting reference documentation is available from SDN.

Note: Don't forget - for scripting to work, you need to enable the sapgui/user_scripting or user_scripting_per_user profile parameters (this will be done by your system administrator, using transactions RZ10 or RZ11) as well as enable it in your SAPGUI settings (Accessibility & Scripting > Scripting)

sapgui/user_scripting

SAPGUI 7.40 Scripting Options

mjturner
  • 1,035
  • 7
  • 16