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
REFINITIV
Question by Sanjit.Rath · Jul 02, 2018 at 07:34 AM · excelvba

Cant call Adfin bond function 'BdCashFlows' from VBA

Hi, I am trying to call Adfin bond module function "BdCashFlows" from VBA. I can create a Bond module by calling "CreateAdxBondModule" however call to BdCashFlows fails with Object Required. I am also not able to reference adxfoo.dll in my project. It shows error while loading dll. Below is my VBA code snippet:

    Dim calcDate As Date
    Dim matDate As Date
    Dim nominalCouponRate As Double
    Dim bondStruct As String
    Dim bdMode As String
    
    
    'cashflow parameters
    
    calcDate = "15-Apr-2000"
    matDate = "01-Dec-2015"
    nominalCouponRate = 0.08
    bondStruct = "FRQ:1 RT:C"
    bdMode = "IAC RET:A16"
    
    
    Dim bm As Object
    Dim cf As Object
    
    'create bond module
    Set bm = CreateAdxBondModule()
    
    'call BdCashFlows
    Set cf = bm.BdCashflows(calcDate, matDate, nominalCouponRate, bondStruct, bdMode)

People who like this

0 Show 2
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.

avatar image
REFINITIV
Zhenya Kovalyov ♦♦ · Jul 02, 2018 at 07:54 AM 0
Share

Where are you importing the dll from?

avatar image
REFINITIV
Sanjit.Rath Zhenya Kovalyov ♦♦ · Jul 02, 2018 at 08:17 AM 0
Share

Hi Zhenya,

I have two binary folders under "C:\Program Files (x86)\Thomson Reuters". I tried importing it from Y & Z folders but all ends with a error.

Eikon\Y\Bin

Eikon\Z\Bin

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Sanjit.Rath · Jul 02, 2018 at 08:49 AM

Hi @Zhenya Kovalyov

Thanks for looking into the query and webex session to resolve the issue. The issue was with explicit types (ex: Date) passed to Adfin BdCashFlows which expects them as variant type.

Secondly, the module type was set up as an object, it should be AdfinXAnalyticsFunctions.AdxBondModule

Corrected code

    Dim calcDate As Variant
    Dim matDate As Variant
    
    Dim nominalCouponRate As Double
    Dim bondStruct As String
    Dim bdMode As String


    Dim bm As AdfinXAnalyticsFunctions.AdxBondModule
    
    Set bm = CreateReutersObject("AdfinXAnalyticsFunctions.AdxBondModule")
    
    calcDate = DateValue("15-Apr-2000")
    matDate = DateValue("01-Dec-2015")
    nominalCouponRate = 0.08
    bondStruct = "FRQ:1 RT:C"
    bdMode = "IAC RET:A16"
    
    Dim res As Variant
    res = bm.BdCashflows(calcDate, matDate, nominalCouponRate, bondStruct, bdMode)
Comment

People who like this

0 Show 0 · 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.

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 >
10 People are following this question.

Related Questions

.Subscribe Method with Cache

How do I trigger a VBA macro from within the TR function in Eikon Excel

RFA Exception Handler - Access Violation / Excel Vba Eikon

Can I determine the Connection state of Eikon Excel with VBA?

VBA / Refresh Eikon Formulas

  • 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