VBA misc
VBA function to check if a user is already logged in
Function IsUserLoggedIn(UserName As String, _
Servername As String) As Variant
IsUserLoggedIn = _
Application.Run("DBRW", Servername & "}ClientProperties" _
, UserName, "STATUS")
End Function
You can then use that in a sub as shown below:
Sub CheckWhetherUserIsLoggedIn()
If IsUserLoggedIn("MyUser", "TM1:") = "ACTIVE" Then
MsgBox "User is logged into TM1."
Else
MsgBox "User is doing something more interesting."
End If
End Sub