python 如何使用python win32com保存为excel文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1742471/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use python win32com to save as excel file
提问by fk.
I have a small python code to open an Excel file. Now I want to "Save As" with a different name but same format. How do I do that.. Any help will be great. FK
我有一个小的 python 代码来打开一个 Excel 文件。现在我想使用不同的名称但相同的格式“另存为”。我该怎么做..任何帮助都会很棒。FK
回答by John Paulett
Here is a tutorial on using the win32com API with Excel and here is the COM method you will likely have to call, Workbook.SaveAs. And here is an example of actually making the call.
这是一个关于在 Excel 中使用 win32com API的教程,这里是您可能必须调用的 COM 方法Workbook.SaveAs。这是实际拨打电话的示例。