Escolar Documentos
Profissional Documentos
Cultura Documentos
DESLOGADO:
LOGADO:
On Error GoTo -1
Application.DisplayAlerts = False
On Error Resume Next
If Not IsObject(ApplicationSAP) Then
On Error Resume Next
Set SapGuiAuto = GetObject("SAPGUI")
If Err Then MsgBox ("Sistema SAP - Não encontrado..!")
Set ApplicationSAP = SapGuiAuto.GetScriptingEngine
If Err Then MsgBox ("Sistema SAP - Cancelado..!")
End If
With Session
.findById("wnd[0]/tbar[0]/okcd").Text = "/o"
.findById("wnd[0]").sendVKey 0
.findById("wnd[0]/tbar[0]/okcd").Text = "/n"
.findById("wnd[0]").sendVKey 0
.findById("wnd[0]/tbar[0]/okcd").Text = Transacao
.findById("wnd[0]").sendVKey 0
mensagem = .findById("wnd[0]/sbar").Text
End Sub