Hyperion Addin not loading when calling VBA from VB

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Hyperion Addin not loading when calling VBA from VB

  1. #1
    New Member
    Join Date
    Apr 2004
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Hyperion Addin not loading when calling VBA from VB

     
    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.

  2. #2
    Board Regular zilpher's Avatar
    Join Date
    Mar 2003
    Location
    Swindon, UK
    Posts
    442
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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
    Z
    ______________________________________________________________________
    Windows 7 Ultimate (x64), Office Professional Plus 2010
    Mac OS X 10.6.4, Office 2008 Mac
    Windows XP Pro, Office 2003
    Debian 5.0 (Lenny), OpenOffice

  3. #3
    New Member
    Join Date
    Apr 2004
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hyperion Addin not loading when calling VBA from VB

    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.

  4. #4
    Board Regular zilpher's Avatar
    Join Date
    Mar 2003
    Location
    Swindon, UK
    Posts
    442
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?
    Z
    ______________________________________________________________________
    Windows 7 Ultimate (x64), Office Professional Plus 2010
    Mac OS X 10.6.4, Office 2008 Mac
    Windows XP Pro, Office 2003
    Debian 5.0 (Lenny), OpenOffice

  5. #5
    New Member
    Join Date
    Apr 2004
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hyperion Addin not loading when calling VBA from VB

    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

  6. #6
    New Member
    Join Date
    Mar 2007
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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}")

  7. #7
    New Member
    Join Date
    Jun 2009
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hyperion Addin not loading when calling VBA from VB

    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

  8. #8
    New Member
    Join Date
    Oct 2009
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hyperion Addin not loading when calling VBA from VB

    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

  9. #9
    New Member
    Join Date
    Jun 2009
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hyperion Addin not loading when calling VBA from VB

      
    Thanks so much! I was having this exact problem and this worked perfectly.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com