Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Nou pe simpatie: princess79
 | Femeie 25 ani Bucuresti cauta Barbat 25 - 60 ani |
|
|
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
|
| #1 |
|
|
If using a Sub inside a HTA file, use the following snippet:
' ################################# VERIFICA DACA E SAP DESCHIS <---- START ----> cod CU Sub
If Not IsObject(application) Then On Error Resume Next Set SapGuiAuto = GetObject("SAPGUI") If SapGuiAuto is Nothing Then MsgBox "Deschide mai intai SAP" Exit Sub 'Wscript.Quit End If On Error Resume Next Set application = SapGuiAuto.GetScriptingEngine If application is Nothing Then MsgBox "Deschide mai intai SAP" Exit Sub 'Wscript.Quit End If End If
If Not IsObject(connection) Then On Error Resume Next Set connection = application.Children(0) If connection is Nothing Then MsgBox "Deschide mai intai SAP" Exit Sub 'Wscript.Quit End If End If
If Not IsObject(session) Then Set session = connection.Children(0) End If
If IsObject(WScript) Then WScript.ConnectObject session, "on" WScript.ConnectObject application, "on" End If
' ################################# VERIFICA DACA E SAP DESCHIS <---- SFARSIT ----> Cod CU Sub |
If using a VBS file without a HTA part (no Sub), use the following snippet:
' ################################# VERIFICA DACA E SAP DESCHIS <---- START ----> Cod FARA Sub
If Not IsObject(application) Then On Error Resume Next Set SapGuiAuto = GetObject("SAPGUI") If SapGuiAuto is Nothing Then MsgBox "Deschide mai intai SAP" Wscript.Quit End If On Error Resume Next Set application = SapGuiAuto.GetScriptingEngine If application is Nothing Then MsgBox "Deschide mai intai SAP" Wscript.Quit End If End If
If Not IsObject(connection) Then On Error Resume Next Set connection = application.Children(0) If connection is Nothing Then MsgBox "Deschide mai intai SAP" Wscript.Quit End If End If
If Not IsObject(session) Then Set session = connection.Children(0) End If
If IsObject(WScript) Then WScript.ConnectObject session, "on" WScript.ConnectObject application, "on" End If
' ################################# VERIFICA DACA E SAP DESCHIS <---- SFARSIT ----> Cod FARA Sub |
_______________________________________

|
|
| |
|