Hyperion Addin not loading when calling VBA from VB

dzlmbq

New Member
Joined
Apr 27, 2004
Messages
13
I one last hurdle with a Excel VB wrapper I am working on and did not see the issue in the forum.

I am calling VBA from a stand alone VB application. The VBA application has a Hyperion Essbase Addin which loads upon opening the xl spreadsheet.

When I call Workbooks.Open(HyperionXL), the Addin does not load. This call is made in my stand alone VB app. When I open the HyperionXL file manually it opens kicks off the Addin.

Any suggestions on how to enable the Addin from a VB application would be greatly apprecaited.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi dzlmbq

You'll need to explicitly open the addin as well as your workbooks, in this code I have used vb6 to open an excel instance, make it visible and then open a workbook called key pad.xls; after that I open an addin called PTools in which I run the auto open events:

Code:
Private Sub Command1_Click()
Dim appXL As Excel.Application
Set appXL = New Excel.Application

appXL.Visible = True
appXL.Workbooks.Open ("c:\data\key pad.xls")
appXL.Workbooks.Open("C:\Documents and Settings\zilpher\Application Data\Microsoft\AddIns\PTools.xla").RunAutoMacros (xlAutoOpen)
Stop
appXL.Quit
Set appXL = Nothing

End Sub

I take it you are early binding to excel? If so this should make sense.

HTH
 
Upvote 0
Thanks for the reply. I tried the code you suggested and am having one issue.

The add-in is loaded. I can list each add in by looping through the add-ins and displaying them in a message box. What is not happening to the specific one is it does not load when I open the workbooks. I do not have access to the api the add-in provides due to this. I am early binding to the XL as well. Any thought to why it is not being loaded? Can I force it to load before I actually open my test XL?

If I close the workbook while debugging, I see the splash screen for the add-in. When I open an XL without using VB I get the splash screen upon starting Excel.
 
Upvote 0
dzlmbq

I have neither the addin nor your code so stabbing in the dark a bit here: try loading the addin first, followed by a do events, then open a workbook.

If that doesn't work, maybe a sleep after loading the addin?
 
Upvote 0
Ok, here is what I found. If the AddIn is not 'checked' in Excel, it will load properly. Once I 'Add' it programatically, it does not load properly after the first addition. I am trying to find a proper way to initialize the addin. Here is the code. I cannot open the AddIn before I open the XL sheet or I get an error. I also tried a sleep of different levels.

Private Sub Command2_Click()

Dim appXL As excel.Application
Set appXL = New excel.Application
Dim inXL As excel.AddIn

appXL.Visible = True

appXL.Workbooks.Open ("C:\Files\Test1.XLS")
Set inXL = excel.AddIns.Add("C:\Hyperion\Essbase\Bin\ESSEXCLN.XLL")

inXL.Installed = True

appXL.Workbooks.Open ("C:\Hyperion\Essbase\Bin\ESSEXCLN.XLL")

Sleep 15000
appXL.Quit

Set appXL = Nothing
Set inXL = Nothing

End Sub
 
Upvote 0
I figured out how to do this with a work around. It may not be the most efficient, but if your using this to auto open a file and runa excel query to upload or send out automatically it probably will work fine. use the SendKeys method to open the .xll file after youve opened excel and it will load in the addin.
here is an example:

System.Windows.Forms.SendKeys.Send("^o")

System.Windows.Forms.SendKeys.Send("C:\Program Files\Hyperion\Essbase\Bin\essexcln.xll")

System.Windows.Forms.SendKeys.Send("{ENTER}")
 
Upvote 0
Hi there,

Did you ever find a solution to this issue.

I am struggling with exactly the same problem, cannot get the essbase menu to appear when i am starting excell via vbs

If you found a solution, i would really liek to hear from you.

Cheers

Neil
 
Upvote 0
Hi

I found the solution and wanted to update this thread
The problem is that the addin isnt loaded even though Excel thinks it is. So you need to modify the code to unload and then reload like this:

Private Sub Command2_Click()

Dim appXL As excel.Application
Set appXL = New excel.Application
Dim inXL As excel.AddIn

appXL.Visible = True

appXL.Workbooks.Open ("C:\Files\Test1.XLS")
Set inXL = excel.AddIns.Add("C:\Hyperion\Essbase\Bin\ESSEXCLN.XLL")

inXL.Installed = false
inXL.Installed = True

appXL.Workbooks.Open ("C:\Hyperion\Essbase\Bin\ESSEXCLN.XLL")

Sleep 15000
appXL.Quit

Set appXL = Nothing
Set inXL = Nothing

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,956
Latest member
JPav

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