SAP 语句结束 VBA

End of statement VBA with SAP

我正在用 conexion 做宏但是错误 "End of Statement" 出现和语法错误

我尝试了重复的反引号但没有成功,其他错误 出现

LINHA = 11
Cells(11, 1).Select

Cells(LINHA, 2).Value = session.findById("wnd[0]/usr/shell/shellcont[1]/shell[1]").Text"          2", "&Hierarchy"

从语法上讲,您基本上是这样的(取决于我们正在查看的 post 的哪个版本):

Object.Property = Object.Method(arguments).Property"some stray string literal", "another string literal"
                                                   ^ end of statement expected here

虽然这是一个法律声明:

Object.Property = Object.Method(arguments).Property

要么删除杂散的字符串文字,要么将其作为 findById 方法的参数的一部分 - 我不知道 SAP API,但由于您正在针对它进行编码,所以您应该可以访问一些文档来解释预期的参数是什么。

此代码将编译 - 我再次不知道 SAP API 想要看到什么,因此它可能会在 run-time 处崩溃,但至少它是合法代码:

ActiveSheet.Cells(LINHA, 2).Value = session.findById("wnd[0]/usr/shell/shellcont[1]/shell[1]", 2, "&Hierarchy").Text