I'm working with VBA and GuiXT separated and now I'm trying to use the SAP GUI VBA integration instead, but i think it's not working because I'm missing a permission.
I tried the code I've found in this thread:
Sub test()
Dim SapGuiAuto As Object
Dim SAPApp As Object
Dim SAPCon As Object
Dim session As Object
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApp = SapGuiAuto.GetScriptingEngine
Set SAPCon = SAPApp.Children(0)
Set session = SAPCon.Children.ElementAt(0)
SAPCon.FindById("wnd[0]").Maximize
End Sub
It runs and SAP informs me that a script tries to connect to SAP, but the line Set session = SAPCon.Children.ElementAt(0)
gives me error 614: "The enumerator of the collection cannot find en element with the specified index".
So I googled and found out, that I'm missing the option "Script recording and playback" in SAP, it's greyed out. And i googled further and I found out, that I'm missing the permission to record or playback a script. Because of that I'd like to know: if I don't have the permission in SAP to record or playback a script, then that's the reason for my not working VBA code, right?