Compile Error thrown when calling blpapicomLib2

1.6k Views Asked by At

Here is the beginning of my class module:

Option Explicit

Private WithEvents session As blpapicomLib2.session
Private cid As blpapicomLib2.CorrelationId

Dim subFields As Variant
Dim securitiesArray() As String

These five lines are straight from the Bloomberg API example files. If I open the example spreadsheet and run the sub in question, it's fine. If I copy the code into another VBA editor in a new workbook, I get the "Compile Error: User-defined type not defined," with the second line highlighted. If I comment it out, same error is thrown except the first line is then highlighted.

I'm very confused. Is there a reference outside of the code I'm forgetting to make?

1

There are 1 best solutions below

0
On BEST ANSWER

I was missing a reference to the Bloomberg API, which I was able to change under in the references menu (Tools->References). Smooth sailing after that.