Connect to SAP INES system


I am trying to connect to a SAP system from Excel VBA and am getting an error on the line
Set SapGuiApp = CreateObject
What software do I need on my machine to connect to a SAP INES system
I don't know a lot about connecting to online SAP test systems so need a little guidance

Sub Logontrial()
Dim SapGuiApp As Object
Dim oConnection As Object
Dim session As Object
Dim SAPCon As Object, SAPSesi As Object
Dim SAPGUIAuto As Object, SAPApp As Object
'Dim sapConnection As Object

If SapGuiApp Is Nothing Then
    Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If oConnection Is Nothing Then
    Set oConnection = SapGuiApp.OpenConnection("110 PRD-P01 ECC", True)
End If
If SAPSesi Is Nothing Then
   Set SAPSesi = oConnection.Children(0)
End If
 'sapConnection.Client = "100"
 'sapConnection.User = "USER"
 'sapConnection.Password = "PASSW"
 'sapConnection.Language = "EN"
 'If nsapConnection.Logon(1, True) = True Then
 '  MsgBox "No connection to R/3!"
 'End If
    'Set SAPCon = SAPApp.Children(0)
    'Set SAPSesi = SAPCon.Children(0)
    Application.DisplayAlerts = False
 With SAPSesi
    .findById("wnd[0]/usr/txtRSYST-MANDT").Text = "100"
    .findById("wnd[0]/usr/txtRSYST-BNAME").Text = "USER"
    .findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "PASSW"
    .findById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
    .findById("wnd[0]").sendVKey 0
    'start extraction
    .findById("wnd[0]/tbar[0]/okcd").Text = "/NZGLLISTBRULE"
    .findById("wnd[0]").sendVKey 0
    End With
     Application.DisplayAlerts = True
     MsgBox "After clicking OK, this SAP session is terminated."
End Sub
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MurpheyApplication ConsultantCommented:
On what type of Hardware is SAP running?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I was told that there are demo versions of SAP in the cloud that anyone can connect to
MurpheyApplication ConsultantCommented:
I don 't think that they let you connect to a demo server with VB (need ODBC to do that)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks. Do you have any code or links on this.
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
sap user scripting is just using the gui. Check the gui install to make sure you have all the front end components.

I am not sure IDES will limit scripting.

tcode rz11 and enter sapgui/user_scripting, check to see if it is there and if dynamically switchable is checked.

If so, change the value to TRUE.

I just checked ides, it does allow for this.

To keep that scripting setting permanent, put it in as a profile parameter in rz10.

After that you have to tell the sid you it will allow user scripting.
Go to gui options and select accessibility & scripting and check "enable scripting" (and select or unselect the sub checkboxes as needed).

You will also need to be running the saplogon pad when you run your script.
With all this, you should be able get to a logon screen.

The code you list appears to be trying to hook to a productive system and call a z tcode.
In order for that to work you will need to make sure that either basis or security allow or can set the profile parameter for you (there is one to allow just for specific users). You will also need to be granted the proper authorizations for the user performing the script.
Also large amounts of data going over the gui may time out, consume workprocesses, check with abap to see if they can help you out with better methods for data extractions.

And of course, there is a jco connector and a .net connector which you can use to access sap abap as well.

Sorry, I know this message was from last month,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.