Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 python 中使用 win32com 打开一个写保护的 ms excel 2007 文件——我知道密码。我可以通过用户在 Excel 对话框中输入密码来打开它。我希望能够在没有任何用户交互的情况下打开文件。我尝试了以下方法,但它仍然会弹出对话框。
app.Workbooks.Open("filename.xls", WriteResPassword="secret")
请问我做错了什么?
谢谢,
戴夫。
如果我不尝试使用命名函数参数,我可以让上面的代码工作。即以下工作:
app.Workbooks.Open("filename.xls", 2, True, None, None, "secret")