How to integrate Excel =RTD() function in python

三世轮回 提交于 2019-12-12 01:53:36

问题


I am using a real-time-data from a proprietary application which provides real time weather data. All I know know from the data is, it provides a link to import to excel as:

=RTD("4cast.wetter",,"city","parameter") This parameter includes Temperature, Humidity, Wind speed, Rain fall etc.

I tried reading the support link provided at excel documentation but couldn't get if it could be used with Python. http://support.microsoft.com/kb/289150

So now my real purpose is to use this Data received by RTD function in excel directly in Python.

As said in RTD documentation, "call a Component Object Model (COM) Automation server to retrieve data in real time" Is there a midway to integrate this COM server with Python?

Thank you.


回答1:


From the link which you have provided it seems that Microsoft has provided a wrapper for VBA(but not for Python).

I would suggest to check with the data provider if he offers an API to Python. This has nothing to do with Excel, but it would allow you to receive data directly into Python.

Another option is to receive data in Excel using RDT and use something like xlwings module http://xlwings.org/ to get data from Excel to Python.




回答2:


You can stream real time data into Excel as an RTD function using PyXLL.

See https://www.pyxll.com/docs/userguide/rtd.html for details, or have a look at this article that shows how to stream live tweets into Excel with Python https://www.pyxll.com/blog/a-real-time-twitter-feed-in-excel/



来源:https://stackoverflow.com/questions/28989873/how-to-integrate-excel-rtd-function-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!