Option Explicit
Sub Test()
Dim SapGuiAuto As Object
Dim Application As SAPFEWSELib.GuiApplication
Dim Connection As SAPFEWSELib.GuiConnection
Dim Session As SAPFEWSELib.GuiSession
Dim Window As SAPFEWSELib.GuiModalWindow
Dim Coll As SAPFEWSELib.GuiCollection
Set SapGuiAuto = GetObject("SAPGUI")
If Not IsObject(SapGuiAuto) Then
Exit Sub
End If
Set Application = SapGuiAuto.GetScriptingEngine()
If Not IsObject(Application) Then
Exit Sub
End If
Set Connection = Application.Connections(0)
If Not IsObject(Connection) Then
Exit Sub
End If
Set Session = Connection.Sessions(0)
If Not IsObject(Session) Then
Exit Sub
End If
Set Window = Session.FindById("wnd[1]")
If IsObject(Window) Then
Set Coll = Window.DumpState("")
Stop
End If
Set Coll = Nothing
Set Window = Nothing
Set Session = Nothing
Set Connection = Nothing
Set Application = Nothing
Set SapGuiAuto = Nothing
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |