[Python] Hiding the SAP GUI window while accessing it through python

Discussão em 'Python' iniciado por Stack, Julho 18, 2025.

  1. Stack

    Stack Membro Participativo

    I am able to launch the SAPLogon in the background by using this VBS script.

    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run "saplogon.exe" , 0


    But when I try to get the instance in Python using the following command and try to connect, it becomes visible.

    import win32com.client

    sapguiauto = win32com.client.GetObject('SAPGUI')
    application = sapguiauto.GetScriptingEngine
    connection = application.OpenConnection('INS_Name',True)


    Is there a way to prevent it from coming to the foreground?

    Continue reading...

Compartilhe esta Página