Excel Hyperion Addin not loading when calling VBA from VB from Mr Excel



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Hyperion Addin not loading when calling VBA from VB
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

dzlmbq
Board Regular


Joined: 27 Apr 2004
Posts: 7

Flag: Blank

Status: Offline

 Reply with quote  

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.

Post Wed May 05, 2004 6:22 pm 
 View user's profile Send private message

zilpher
Board Master


Joined: 27 Mar 2003
Posts: 235
Location: The town they forgot to bomb: Swindon
Flag: England

Status: Offline

 Reply with quote  

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


Post Thu May 06, 2004 6:20 am 
 View user's profile Send private message Visit poster's website

dzlmbq
Board Regular


Joined: 27 Apr 2004
Posts: 7

Flag: Blank

Status: Offline

 Reply with quote  

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.

Post Fri May 14, 2004 6:25 pm 
 View user's profile Send private message

zilpher
Board Master


Joined: 27 Mar 2003
Posts: 235
Location: The town they forgot to bomb: Swindon
Flag: England

Status: Offline

 Reply with quote  

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


Post Sat May 15, 2004 5:46 am 
 View user's profile Send private message Visit poster's website

dzlmbq
Board Regular


Joined: 27 Apr 2004
Posts: 7

Flag: Blank

Status: Offline

 Reply with quote  

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

Post Mon May 17, 2004 2:21 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.