[Python] Python Win32Com: How do I open a password-protected Powerpoint?

Discussão em 'Python' iniciado por Stack, Agosto 22, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to use the below code to open a password-protected ppt, but I got error: TypeError: Open() got an unexpected keyword argument 'Password'

    Is it possible to use Win32Com to open a password-protected powerrpoint? Thank you


    import win32com.client as win32
    xl = win32.Dispatch('PowerPoint.Application')
    xl.Visible = True
    xl.DisplayAlerts = True

    wb = xl.Presentations.Open(r'C:\Users\Downloads\PPT File.ppt', Password="123")

    Continue reading...

Compartilhe esta Página