10-28-2019 8:32 AM - edited 02-03-2024 5:33 PM
Hello,
I am wanting to automate some stuff in SAP through VBA. For now, I am trying to execute the following code:
Set SapGuiAuto = GetObject("SAPGUI") 'Get the SAP GUI Scripting object
Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI
Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
Set session = SAPCon.Children(0) 'Get the first session (window) on that connection
The last line is resulting in a error: "Run-time error '614'". I placed SAPCon in the watch window but it has a count of 0 for sessions. Despite SAP Easy Access being open in the background. The rest of the lines execute fine.
Also, GUI scripting is enabled on my local computer but not the server. But, I looked at the documentation and it said I can still scripts, just not record them. If this is what's causing the issues then I wonder if I can use SAP's ActiveX libraries instead? I have no way of getting GUI scripting enabled on the server side.
Any help is appreciated.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.