The enumerator of the collection cannot find en element with the specified index.
I get the above error on line number of 3 of the following code:
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
Set connection = application.Children(0)
How to check size of application.Children?
Probably the SAP (SAP Logon/SAP GUI) are not open.
But if you want, try:
ChildCount = application.Children.Count