使用SAP GUI和VBScript时,application.Children是一个空列表:

问题描述

The enumerator of the collection cannot find en element with the specified index.

我在以下代码的第3行上收到上述错误

Set SapGuiAuto  = Getobject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
Set connection = application.Children(0)

如何检查申请的大小。孩子?

解决方法

可能未打开SAP(SAP登录/ SAP GUI)。

但是,如果需要,请尝试:

ChildCount = application.Children.Count