Hi All,
I found the below mentioned code in this form to launch SAP via VBS script.
But when I am running the same code its giving me error.
Could you please assist, what modification I need to do here.
Below is the snapshot of error and Script
'-Begin-----------------------------------------------------------------
'-Directives----------------------------------------------------------
Option Explicit
'-Variables-----------------------------------------------------------
Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle
'-Main----------------------------------------------------------------
Set WSHShell = WScript.CreateObject("WScript.Shell")
If IsObject(WSHShell) Then
'-Set the path to the SAP GUI directory---------------------------
SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"
'-Set the SAP system ID-------------------------------------------
SID = "P12"
'-Set the instance number of the SAP system-----------------------
InstanceNo = "31"
'-Starts the SAP GUI----------------------------------------------
WSHShell.Exec SAPGUIPath & "sapgui.exe " & SID & " " & _
InstanceNo
'-Set the title of the SAP GUI window here------------------------
WinTitle = "SAP"
While Not WSHShell.AppActivate(WinTitle)
WScript.Sleep 250
Wend
Set WSHShell = Nothing
End If
'-End-------------------------------------------------------------------

