VBA for Essbase Hyperion

aja4481

New Member
Joined
Mar 15, 2011
Messages
26
Hi all. I'm now using Hyperion Essbase within Excel and I was wondering if anyone out there had any coding that could be helpful for pulling data. So I have the below code to refresh a data page but I'm still trying to find helpful tools to automate data pulling.

Any help would be appreciated!

Sub Hyperion_Refresh()
Sheets("Sheet1").Select
Range("A1:I9").Select
Application.Run macro:="EssMenuRetrieve"
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I'd usually use something like this:

Code:
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
 
Upvote 0
It will connect to the database, retrieve the data, and disconnect from the database.
 
Upvote 0
just curious, why is so much code needed to log in? the initial code I posted logs you in and then you can use the below code to disconnect

Sub Disconnect_US()
Sheets("Data Sheet").Select
Range("A1:X241").Select
Application.Run macro:="EssMenuDisconnect"
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top