Through my VBA code I logon to SAP. I am trying to check if the login was successful using the following line of code: session.findbyId("wnd[0]/sbar").MessageType = "S"
but it keeps printing false although I did successfully login. Any help will be greatly appreciated.
CodePudding user response:
You can check if session.Info.user
contains the user name you used to logon with. In that case you are logged on.
Or you check if session.Info.user="SAPSYS"
or session.Info.user=""
. In that case you still have the Logon Screen and you are not logged in.