开发者

How to open write reserved excel file in python with win32com?

I'm trying to open a write-protected ms excel 2007 file using win32com in python -- I know the password. I can open it with user input of the password into the excel dialog box. I want to be able to open the file without any user interaction. I've tried the following, but it still pops up the dialog bo开发者_运维百科x.

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

Any ideas what I'm doing wrong please?

Thanks,

Dave.


I can get the above code to work if I don't try to use named function parameters. I.e. the following works:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜