Skip to Content
avatar image
Former Member

Why I do not manage to run @Stefan Schnell scrip without error?

This is the 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 = "NSP"

'-Set the instance number of the SAP system-----------------------

InstanceNo = "00"

'-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

MsgBox "Here now your script..."

'-End-------------------------------------------------------------------

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 14, 2016 at 07:25 PM

    I am attaching two screenshots: the error window as well as the SAP Logon Window. The SID I have to use is CS1. Hope you can help me.

    @Stefan Schnell is the author of the script I want to use.

    Add comment
    10|10000 characters needed characters exceeded