需要插入变量以使用vbs脚本遍历SAP表。错误“列表定界符”或“)”缺失不断出现。我想念什么?

时间:2019-10-29 23:02:08

标签: excel loops vbscript sap

'过去我在SAP中遍历过表,但是我无法弄清楚以下代码中的区别。

Dim Row_Numb
Dim i_col
Dim j_col
Dim k_col


Row_Numb = 0
i_col = 0
j_col = 1
k_col = 2

While items_in_class <> ""
      i_col = CStr(i_col)
      j_col = CStr(j_col)
      k_col = CStr(k_col)

'Original line from Script recording. This works
'Cells(6, 3).Value = SapSession.FindById("wnd[0]/usr/tabsTABSTR/tabpMERK/ssubSUB:SAPLCLMO:0130/tblSAPLCLMOMERKMAL/txtRMCLM-SMERKB[1,1]").Text

'Replacing [1,1] with variables Row_Num and variable to iterate. It doesn't work
Cells(6, 3).Value = SapSession.FindById("wnd[0]/usr/tabsTABSTR/tabpMERK/ssubSUB:SAPLCLMO:0130/tblSAPLCLMOMERKMAL/txtRMCLM-SMERKB["&Row_Numb&"."&i_col&"]").Text

0 个答案:

没有答案