How to open excel reserved file entry in python using win32com?

I am trying to open ms excel 2007 file with write protection using win32com in python - I know the password. I can open it by entering the user password in the Excel dialog box. I want to be able to open a file without any user interaction. I tried the following, but a dialog still appears.

app.Workbooks.Open("filename.xls", WriteResPassword="secret")

Any ideas what I'm doing wrong please?

Thank,

Dave

+2
source share
1 answer

I can make this code work if I don't try to use named functions. That is, the following work:

app.Workbooks.Open("filename.xls", 2, True, None, None, "secret")
+2
source

Source: https://habr.com/ru/post/1569333/


All Articles