Skip to content

Instantly share code, notes, and snippets.

@curipha
Created May 7, 2017 06:45
Show Gist options
  • Save curipha/5f5dd9f422e1aa45d2d2d4e61f24df53 to your computer and use it in GitHub Desktop.
Save curipha/5f5dd9f422e1aa45d2d2d4e61f24df53 to your computer and use it in GitHub Desktop.
Close all SAP session
' ___ _ ___ ___ _ _ ___
' / __| /_\ | _ \ / __| | | |_ _|
' \__ \/ _ \| _/ | (_ | |_| || |
' |___/_/ \_\_| \___|\___/|___|
' Automation
Option Explicit
Dim SapGui, Application, Connection
Set SapGui = GetObject("SAPGUI").GetScriptingEngine
Set Application = SapGui.FindByID("/app")
For Each Connection In Application.Connections
Connection.CloseConnection()
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment