Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access data in Excel - Reuter from python

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")

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

like image 774
nam Avatar asked Mar 25 '23 09:03

nam


2 Answers

Try this -

import os
from win32com.client import GetObject

os.startfile(r'C:\path\to\ReutersExcel.exe')
xlApp = GetObject(None, 'Excel.Application')
like image 109
pyrospade Avatar answered Apr 05 '23 15:04

pyrospade


If you're using Excel to access Thomson Reuters Dataworks Enterprise (former Datastream), then have a look on pydatastream (https://github.com/vfilimonov/pydatastream) - it'll allow you to get the data directly to python in pandas.DataFrame format.

like image 37
Vladimir Avatar answered Apr 05 '23 13:04

Vladimir