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 的路透社
基础教程推荐
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
