A few weeks ago I generated a script via SAP\'s built in GUI scripting functionality, and then put the vba in an excel document and attached it to a button.
this wo
I know it's old, but probably might help someone else. I don't know the reason for this, out of the blue started having problems with my scripts. I recorded a new operation to see what SAP would write for those actions (since that part of the code is standard for the connection). Same code, same problem.
Fix (or at least temporary): Change the number of the child being searched. Previous code:
*Set Connection = Sap_Application.Children(0)*
New code:
*Set Connection = Sap_Application.Children(1)*
Not sure what the difference is, I know that if you also change the number in this line:
*Set session = Connection.Children(0) 'This is the line that causes the error*
the execution takes place in the second session, if you do change this one, also have to change the previous line of code.
Hope it helps!