|
|

楼主 |
发表于 2025-12-16 08:06:42
|
显示全部楼层
上海市上海市
代码其实不重要
Option Explicit
On Error Resume Next
Dim SapGuiAuto, application, connection, session
Set SapGuiAuto = GetObject("SAPGUI")
If Err.Number <> 0 Then
WScript.Quit 1
End If
Set application = SapGuiAuto.GetScriptingEngine
If Err.Number <> 0 Then
WScript.Quit 1
End If
Set connection = application.Children(0)
If connection.Children.Count = 0 Then
WScript.Quit 1
End If
Set session = connection.Children(0)
session.findById("wnd[0]/tbar[0]/okcd").Text = "/ncs03"
session.findById("wnd[0]").sendVKey 0
Set session = Nothing
Set connection = Nothing
Set application = Nothing
Set SapGuiAuto = Nothing
|
|