I'm triyng to write a VBScritp that opens a SAP session, with Single-Sign On capability.
I've already found some information about this topic, or similar ones, here and on other sites, but none of them suit my requirement..
This is what I have so far, taken from link:
But an error happens (please see attached file).error.png.
Can anybody help me?
Option Explicit
Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle
Set WSHShell = WScript.CreateObject("WScript.Shell")
If IsObject(WSHShell) Then
SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"
SID = "PRD"
InstanceNo = "00"
WSHShell.Exec SAPGUIPath & "sapgui.exe " & SID & " " & _
InstanceNo
WinTitle = "SAP"
While Not WSHShell.AppActivate(WinTitle)
WScript.Sleep 250
Wend
Set WSHShell = Nothing
End If