使用Python编写MS Office宏? [英] Using Python to program MS Office macros?
问题描述
过去我通常坚持在VBA中编程,主要用于MS Excel(但也有一点MS Access和Word),并努力寻找方法,使Python可以轻松地完成一个命令。
我想知道是否有合理的方式利用Python的编程能力和易用性,同时利用Office(大部分是Excel)中的各种工具?
p>有一组跨平台的Python工具,称为xlrd,xlwt和xlutils,用于阅读&编写Excel文件。有一些限制(例如,我不认为他们可以处理宏),但是它们允许您在非Windows平台上使用Excel文件,如果这对您有用。请参阅: http://www.python-excel.org/
此外,还有一些问题已经在处理这类主题,包括:
是否有更好的方法(除了COM)远程控制Excel?
I've recently taken it as a project to teach myself how to program in Python. Overall, I must say that I'm impressed with it.
In the past I've typically stuck to programming in VBA mostly for MS Excel (but also a bit in MS Access and Word) and have struggled to find ways to make it do things that Python can easily do with a single command.
I was wondering if there were a reasonable way to harness the programming power and ease of Python while at the same time make use of the various tools in Office (mostly Excel)?
There is a set of cross platform Python utilities - called xlrd, xlwt, and xlutils - for reading & writing Excel files. There are some limitations (e.g. I don't think they can process macros), but they do allow you to work with Excel files on non-Windows platforms, if that's of use to you. See: http://www.python-excel.org/
Also, there are SO questions already dealing with this sort of topic, including this: Is there a better way (besides COM) to remote-control Excel?
这篇关于使用Python编写MS Office宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!