on 07-15-2017 6:30 PM
Hi All,
1) I am running the VB script to log on SAP of my company SID. I gave the SID and instance number correctly and I am getting the below issue.
Where as I am able to open the same through normal Log on successfully.
Could anyone please help on this ?
'-Begin-----------------------------------------------------------------
'-Directives----------------------------------------------------------
Option Explicit
'-Variables-----------------------------------------------------------
Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle
'-Main----------------------------------------------------------------
Sub shell()
Set WSHShell = 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 = "UPD"
'-Set the instance number of the SAP system-----------------------
InstanceNo = "45"
'-Starts the SAP GUI----------------------------------------------
WSHShell.Exec SAPGUIPath & "sapgui.exe " & SID & " " & _
InstanceNo
'-Set the title of the SAP GUI window here------------------------
WinTitle = "SAP"
Set WSHShell = Nothing
End If
MsgBox "Here now your script..."
'-End-------------------------------------------------------------------
End Sub
2) And when I use the below code in above ,it throw error as Variable not found.
So I removed WScript and ran , and got the above issue in SAP Logon , though the script run successfully
Set WSHShell = WScript.CreateObject("WScript.Shell")<br>
Can anyone please help on the issue?
Thanks,
Sumanth
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.