question

Upvotes
Accepted
46 3 5 9

VBA: Object variable or with block variable not set

Hello,

Just got a new computer and trying to get the real time API to work on excel. I followed the installation steps and tried the simplest code from tutorial but it yields me an error "Object variable or with block variable not set".

Below is my code:

Dim WithEvents myRTGet As AdfinXRtLib.AdxRtLi
Sub myRtGetExample()
  Set myRTGet = CreateAdxRtList()
  
  With myRTGet
      .Source = "IDN"
      .RegisterItems "EUR=", "BID"
      .StartUpdates RT_MODE_IMAGE
  End With
End Sub

' Returns the initial image for the instrument. NOTE - .StartUpdates RT_MODE_IMAGE'
Private Sub myRtGet_OnImage(ByVal DataStatus As AdfinXRtLib.RT_DataStatus)
  ' The value for the specific instrument, specific field, only one in this case.'
  Debug.Print myRTGet.Value("EUR=", "BID")
End Sub

Any idea what is happening ?

Thanks for the help!

eikoneikon-com-api
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 11 27

Check the bitness of Excel. Eikon COM APIs are only available as 32-bit libraries, which can only be used in 32-bit Excel. If you have 64-bit Excel you cannot use Eikon COM APIs in Excel VBA.

icon clock
10 |1500

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

Upvotes
46 3 5 9

Fixed ! Thanks!

icon clock
10 |1500

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

Click below to post an Idea Post Idea