cancel
Showing results for 
Search instead for 
Did you mean: 

SAP logon 740 automation error

Former Member
0 Kudos

Hi, I got a problem running my VBA code within Excel.  Before I have no problem connecting to SAP 730 using set sapguiauto=getobject("SAPGUI") but after our IT upgrade to sapgui for windows 740 I could not execute the code with Automation error and invalid syntax and I did a lot of research and testing and just could not find the solution.  I am using these codes in every part of my running program in SAP 730 with no problems.

Sub test()

    Dim App, Connection, session As Object

    Set sapguiauto = GetObject("SAPGUI")

    Set App = sapguiauto.GetScriptingEngine

    Set Connection = App.Children(0)

    Set session = Connection.Children(0)

End Sub

Would really appreciate your help.   Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_brutigam2
Active Participant
0 Kudos

Hi Art

First of all you should learn about Variables and their declaration

Doing this:


Dim App,Connection, Session as Object

only declares session as Object.

App and Connection are Variants

To avoid this you can tell VBA with an Option Explicit at the beginning of Code that all variables must be declared (Dim).

Next thing I would do is to debug your code (F8) and step it through...

To do so mark the first line of Code and press F9 to create a Stop-Mark

Now you can evtl.see where the trouble is

PS:

What evtl comes to my mind () is your SAP System local installed or do you have to connect (for example) via Citrix

greetings

Thomas B

stefan_schnell
Active Contributor
0 Kudos

Hello Art,

welcome in the scripting language forum.

Are you sure that the scripting is installed and activated in the options of the SAP logon?

The SAP GUI Scripting is an optional component and you can decide it to install or not.

Let us know your results.

Cheers

Stefan