Hello Darley,
welcome in the Scripting Language forum.
There are probably two reasons:
- 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------------------------------------------------------------------- - 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.
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