Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon COM /
avatar image
Question by yilin.x.chen · Oct 24, 2018 at 12:56 PM · vbaconnectioncom apicom_apieikon desktop api

Using COM API in VBA code, suddenly cannot connect to Eikon Desktop

we are using COM API in the access VBA code to connect to Eikon Desktop, it worked very fine until one day it shows connection failed.

I have attached the VBA code. Since the code works before and if we switch the computer login profile to another user the code also works, we don't think it is the code has the problem.

So we suspect that the profile we used to login the computer has problem, but I am not sure where the problem could be.

Then we switched the profile and try to run the program. After a while, I got the error "ActiveX cannot create object" which indicates that it could not initialize the Eikon (no Eikon login page initialized). So I reinstall the Eikon on the computer under the new profile. Then we encountered the same problem again: cannot connect to Eikon desktop. Then we realized this might not related to profile used on the computer. We tried new version Eikon and old version Eikon and neither worked.

I just wonder if this issue related to Eikon itself, like reference or installation problem or it associated with the computer system, like firewall or registration key.

Sub Start()
If oEikonConnection Is Nothing Then  Set oEikonConnection = New EikonDesktopDataAPILib.EikonDesktopDataAPI  
oEikonConnection.Initialize
End If

Do Until oEikonConnection.Status
DoEvents
Loop
RequestData =>start to request data after connection

Set oEikonConnection = Nothing
End Sub

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov. · Oct 24, 2018 at 04:26 PM

Calling DoEvents is no guarantee that the property of in-proc COM server will be updated. VBA is single threaded and EikonDesktopDataAPI COM object runs on the same thread as your loop. DoEvents should in theory yield the execution to allow events to be processed, but you cannot rely on it. I’ve seen it producing sporadic results in tests run one right after another on the same machine with the same code. Sometimes it works and sometimes it doesn’t.
To have reliable behavior, instead of sitting in an endless loop waiting for the Status property to change, use OnStatusChanged event provided by EikonDesktopDataAPI COM object.

Comment

People who like this

0 Show 4 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
yilin.x.chen · Oct 25, 2018 at 10:16 AM 0
Share

Hi Alex, I actually tried using OnStatusChanged in the code. However this didn't work because the application did not even connect to Eikon, the initialization failed, so the code will never hit OnStatusChanged function or continue with other parts of the code.

avatar image
REFINITIV
Alex Putkov. ♦♦ yilin.x.chen · Oct 25, 2018 at 12:23 PM 0
Share

When you added the event handler for OnStatusChanged event, did you remove the endless loop and the destroying of EikonDesktopDataAPI object from your Start procedure? The following code should be deleted from Start procedure:

Do Until oEikonConnection.Status
DoEvents 
Loop 
RequestData =>start to request data after connection
Set oEikonConnection = Nothing

The call to RequestData procedure should be moved to OnStatusChanged event handler.

avatar image
yilin.x.chen Alex Putkov. ♦♦ · Oct 25, 2018 at 05:31 PM 0
Share

Yes, I tried to use the VBA code posted on the developer site. However the initialization status always shows a fail. I also have a c# app to connect to Eikon and it always give me disconnected status. And every time I download a new Eikon installer it always showed Download failed so I cannot continue to install the program

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

Login to Reuters EIKON via VBA with username and password

How to connect to Reuters Eikon Excel programmatically with VBA?

Eikon field that returns dividend in the appropriate denomination

Can I find the default Eikon for Excel RHistory fields for an instrument using the COM APIs and VBA?

DEX2 COM API & VBA : Currency field generating an automation error

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges