点击此处---> 群内免费提供SAP练习系统(在群公告中)
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
嗨
我编写了VBA模块,从sapgui中提取数据
但有一个问题,vba不能读取超过82行
Sub xff()
xf11 = 0
xf21 = 0
xf10 = 0
xf22 = 0
如果不是IsObject(VBAPP),则
设置SapGuiAuto = GetObject(" SAPGUI")
设置VBAPP = SapGuiAuto.GetScriptingEngine
如果,如果不是IsObject(Connection),则
连接= VBAPP.Children(0)<如果>不是IsObject(会话),则结束
设置会话= Connection.Children(0),如果<是> IsObject(WScript),则结束< br> WScript.ConnectObject会话,"在"上
WScript.ConnectObject VBAPP," on"在"结束"上
session.findById(" wnd [0]")。maximize
session.findById(" wnd [0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont [0]/shell")。doubleClickNode" F00003"
session.findById(" wnd [0]/usr/btnBUTTON6")。press
session .findById(" wnd [0]")。sendVKey 17
session.findById(" wnd [1]/usr/txtV-LOW")。Text =" 620"
session.findById(" wnd [1 ]/usr/txtV-LOW")。caretPosition = 3
session.findById(" wnd [1]")。sendVKey 8
session.findById(" wnd [0]")。sendVKey 8
session.findById(" wnd [0]")。maximize
session.findById(" wnd [0]/tbar [1]/btn [18]")。press
session.findById(" wnd [0 ]/tbar [1]/btn [33]")。pres s
session.findById(" wnd [1]/usr/cntlGRID/shellcont/shell")。setCurrentCell 5," TEXT"
session.findById(" wnd [1]/usr/cntlGRID/shellcont/shell ").firstVisibleRow = 0
session.findById(" wnd [1]/usr/cntlGRID/shellcont/shell")。selectedRows =" 5"
session.findById(" wnd [1]/usr/cntlGRID /shellcont/shell").doubleClickCurrentCell
设置mygrid = session.findById(" wnd [0]/usr/cntlGRID1/shellcont/shell")
xf11 = mygrid.RowCount
对于xf10 = 1到xf11
Cells(xf10,1)= mygrid.getcellvalue(xf10-1," VBELN")
Cells(xf10,2)= mygrid.getcellvalue(xf10-1," LGORT")
Cells(xf10 ,3)= mygrid.getcellvalue(xf10-1," NAME_WE")
Cells(xf10,4)= mygrid.getcellvalue(xf10-1," ZZTEXT")
Cells(xf10,5)= mygrid。 getcellvalue(xf10-1," MATNR")
Cells(xf10,6)= mygrid.getcellvalue(xf10-1," ARKTX")
Cells(xf10,7)= mygrid.getcellvalue(xf10-1, " S_MEINS")
单元格(xf10,8)= mygrid.getcellvalue(xf10-1," S_LGMNG")
单元格(xf10,9)= mygrid.getcellvalue(xf10-1," VOLUM")
单元格(xf10, 10)= mygrid.getcellvalue(xf10-1," BRGEW")
Cells(xf10,11)= mygrid.getcellvalue(xf10-1," WBSTK")
Cells(xf10,12)= mygrid.getcellvalue (xf10-1," WADAT")
单元格(xf10,13)= mygrid.getcellvalue(xf10-1," LFDAT")
Cells(xf10,14)= mygrid.getcellvalue(xf10-1," WERKS")
Cells(xf10,15)= mygrid.getcellvalue(xf10-1," ORT01_WE")
Cells(xf10,16)= mygrid.getcellvalue(xf10-1," VRKME")
单元格(xf10,17)= mygrid.getcellvalue(xf10-1," S_VGBEL")
单元格(xf10,18)= mygrid.getcellvalue(xf10-1," S_CHARG")
单元格(xf10,19) = mygrid.getcellvalue(xf10-1," VSTEL")
Cells(xf10,20)= mygrid.getcellvalue(xf10-1," VKORG")
Cells(xf10,21)= mygrid.getcellvalue(xf10 -1," KODAT")
下一个xf10
/---------------------------------------------- ------------
一周热门 更多>