Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2806

Re: Run VBS script when logged through SAP shortcut

$
0
0

Hello Darley,

 

welcome in the Scripting Language forum.

 

There are probably two reasons:


  1. Your SAP Logon or SAP Logon Pad is not running, start it and try it again.

    If you don't want to start the SAP Logon explicite, you can also use another way:
    '-Begin-----------------------------------------------------------------

      '-Sub Main------------------------------------------------------------

        Sub Main()
          sapServer = "/H/10.100.200.150/S/3200" 'Insert here your IP and Port
          Set sap = CreateObject("Sapgui.ScriptingCtrl.1")

          Set sapCon = sap.OpenConnectionByConnectionString(sapServer, True)
          If IsObject(sapCon) Then
            MsgBox "Connection successful"
          Else
            MsgBox "Connection failed"
          End If
          sapCon.Close
        End Sub

      '-Main----------------------------------------------------------------
        Main()

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

  2. You are using a 64-bit Windows (x64) and with the shortcut you start also the x64 Windows Scripting Host, but the 64-bit WSH can't use 32-bit (x86) objects.
    002.jpg
    Choose in your shortcut C:\Windows\SysWOW64\wscript.exe and the name of your script.


Try it and let us know your results.


Cheers

Stefan


Viewing all articles
Browse latest Browse all 2806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>