我正在使用 Excel 中集成的路透社来检索市场数据.对于任务自动化,我目前使用 VBA,但现在我想切换到 python.pyxll这个包没有多大帮助,因为原理和VBA一样(我需要在Excel里面点击RUN按钮...)所以我正在考虑使用 win32com 从外部通过 COM 对象访问 Excel.但是,当我这样做时:
I'm using Reuters integrated in Excel to retrieve market data. For task automation , I currently use VBA but now I want to switch to python. The package pyxll does not help much because the principle is the same as VBA (I need to be inside Excel and click on the RUN button...)
So I'm considering using win32com to access to Excel from outside with COM object. However, when I do:
from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
此代码打开一个新的 Excel 实例,其中没有 Reuter 插件(因此我无法使用 Reuter 函数检索数据).我不知道如何从 python 访问 Excel-with-Reuter 实例?我查看了 Com Explorer 来探索该服务,除了 Excel 之外我没有看到任何其他服务
This code opens a new instance of Excel that does not have Reuter add-in in there (thus I can't use the Reuter function to retrieve data). I don't know how to access to Excel-with-Reuter instance from python?
I've taken a look at Com Explorer to explore the service and I didn't see any other service than Excel
试试这个 -
import os
from win32com.client import GetObject
os.startfile(r'C:path oReutersExcel.exe')
xlApp = GetObject(None, 'Excel.Application')
这篇关于在 Excel 中访问数据 - 来自 python 的路透社的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
python:不同包下同名的两个模块和类python: Two modules and classes with the same name under different packages(python:不同包下同名的两个模块和类)
配置 Python 以使用站点包的其他位置Configuring Python to use additional locations for site-packages(配置 Python 以使用站点包的其他位置)
如何在不重复导入顶级名称的情况下构造python包How to structure python packages without repeating top level name for import(如何在不重复导入顶级名称的情况下构造python包)
在 OpenShift 上安装 python 包Install python packages on OpenShift(在 OpenShift 上安装 python 包)
如何刷新 sys.path?How to refresh sys.path?(如何刷新 sys.path?)
分发带有已编译动态共享库的 Python 包Distribute a Python package with a compiled dynamic shared library(分发带有已编译动态共享库的 Python 包)