I’m running some macros to connect to Essbase and retrieve data but I’m getting the following error messages with hCtx =0
Global Const ESB_API_VERSION = &H65600
Const aoiEssInitFailure = 10004
Declare Function EsbInit Lib "esbapin" (pInit As ESB_INIT_T, phInst As Long) As Long
Dim glhInst As Long
hCtx = EssVGetHctxFromSheet(wsFullName(strSheetName)) ' returns 0
status = EsbValidateHCtx(hCtx) ' message number 1030001
If status <> 0 Then
With oInit
.Version = ESB_API_VERSION ‘shows a version number 415232
.LocalPath = String$(ESB_PATHLEN, vbNullChar)
.MessageFile = String$(ESB_PATHLEN, vbNullChar)
.HelpFile = String$(ESB_PATHLEN, vbNullChar)
.MaxHandles = 10
.ClientError = ESB_TRUE
.ErrorStack = 100
End With
status = EsbInit(oInit, glhInst)
If glhInst = 0 Then Err.Raise aoiEssInitFailure, , "Could not initialize Essbase API."
''here I get the error message because glhInst =0
The first part of the code finds the Essbase path by finding Environ("ARBORPATH") and then registers the add-in
I read an article about some conflict generated by the Ev Variables so I listed below all the ones related to Essbase, don’t know if makes any difference