Declare Function EssVConnect Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal userName As Variant, ByVal password As Variant, _
ByVal Server As Variant, ByVal Application As Variant, ByVal Database As Variant) As Long
Declare Function EssVDisconnect Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant) As Long
Declare Function EssVRetrieve Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal range As Variant, ByVal lockFlag As Variant) As Long
Declare Function EssVSetGlobalOption Lib "ESSEXCLN.XLL" (ByVal item As Long, ByVal globalOption As Variant) As Long
Sub GetUpdatedData()
Call EssVSetGlobalOption(6, False)
Call EssVConnect("Sheet_Name_Goes_Here", "User_Name_Goes_Here", "Password_Goes_Here", _
"Server_goes_here", "Application_Listed_on_the_Left_goes_here", _
"Database_Listed_on_the_Right_goes_here")
Call EssVRetrieve("Sheet_Name_Goes_Here", range("Range_of_Essbase_Query_goes_here_e.g.A4:O9"), Null)
Call EssVDisconnect("Sheet_Name_Goes_Here")
‘Repeat (adjusting as necessary) the three Call statements above as many times as needed for your workbook
Call EssVSetGlobalOption(1, False)
Call EssVSetGlobalOption(2, False)
Call EssVSetGlobalOption(6, True)
End Sub