Hello, We are currently using DataStream DFO Excel Add-In and wish to automate some of the data capture via a Python Script that first Opens Excel that has DFO Add-In installed and then pushes the DSGRID Formula into a Cell with the required parameters.
What I would like to know is if there is a call that can be made to DFO within this context that will allow me to determine the Connection LogIn Status and login if necessary.
Thanks in advance
There is a VBA command to display if Eikon/DFO is online
Private Sub CommandButton5_Click()
Set nObj = Application.COMAddIns("PowerlinkCOMAddIn.COMAddIn").Object.sharedObject
MsgBox ("Connected :" & nObj.GetApplicationOnlineStatus())
Hi. I have made some progress with this but am still either missing some piece of fundamental knowledge or I am on the wrong trail altogether.
I am able to 'connect' to the Excel Application Object and see that COMAddIns is populated with (in my case) 4 AddIns. One of which is "DFOAddInExcel2016"
PYTHON snippet so far is
xlApp = win32com.client.gencache.EnsureDispatch("Excel.Application") xlApp.Visible = 1 for addin in self.xlApp.COMAddIns: print(addin.description)
Microsoft Power View for Excel DFOAddInExcel2016 Microsoft Power Map for Excel Datastream Charting Addin
But I don;t see the PowerlinkCOMAddIn.COMAddIn object and therefoe any attempt to access properties or methods on this fail with an index error.
I have tried your suggestion of calling GetApplicationOnlineStatus() against the DFO AddIn I can see but this reports an error as I don't believe that is an function of this particular DFO AddIn.
print(xlApp.COMAddIns("DFOAddInExcel2016").GetApplicationOnlineStatus()) Traceback (most recent call last): File "C:\tgm\bin\anaconda3\envs\tgm-py368\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-70-19e551b05640>", line 1, in <module> print(xlApp.COMAddIns("DFOAddInExcel2016").GetApplicationOnlineStatus()) File "C:\tgm\bin\anaconda3\envs\tgm-py368\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__ raise AttributeError("%s.%s" % (self._username_, attr)) AttributeError: <unknown>.GetApplicationOnlineStatus
Any ideas on how I can establish what all of the available functions and properties maybe for the "DFOAddInExcel2016" COM Object? I know that 'description' is available but beyond that I am in the dark.
thanks in advance
BTW. Google shows zero results for "DFOAddInExcel2016"
The answer from @paul.bacon assumed you were using Datastream for Office (DFO) Excel Add-In as part of an Eikon terminal. Since you don't have "Thomson Reuters Eikon - Microsoft Office" listed under Excel's Application.COMAddIns collection, it doesn't look like you have Eikon installed on this machine. What Refinitiv product do you subscribe to that includes Datastream for Office (DFO) Excel Add-In?
Thanks. That will explain it (I think). We have a legacy (pre-Eikon) subscription going back some years. From what I can gather it may be a subscription to specific datasets and these seem to come packaged with the DFO Excel Add-In which is installed separately as an Add-In (ie. there is no Terminal install)