Access data in Excel - Reuter from python(在 Excel 中访问数据 - 来自 python 的路透社)
问题描述
我正在使用 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 的路透社的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Excel 中访问数据 - 来自 python 的路透社
基础教程推荐
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 包装空间模型 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
