Solved

Why my add-in is associated with a workbook and not the Excel application in Excel 2013

Posted on 2015-02-23
7
73 Views
Last Modified: 2016-02-10
I have created an Excel Add-in with VB.net in Visual Studio 2005. Currently I test my Add-in with Excel 2013, but it should also run on Excel 2007 and 2010.

When I install my Add-in and I open Excel 2013, I open a workbook (in the code) and the "ADD-INS" tab appears with the items in my menu which are activated on a mouse click. However, I must hide this workbook to add another empty workbook (I must repeat this with several open workbooks).

The problem is that even if the "ADD-INS" tab appears with the opening of others workbooks, menu items react only on the first open workbook and remains inactive for other workbooks open thereafter.

I would like that my add-in is active and operational for all workbooks (even those opened by the user). So I want to associate the menu of my add-in to the entire Excel application, not to each individual workbook. So for each workbook, the menu items must react to mouse clicks (as is currently the case with the first workbook ).
0
Comment
Question by:aaci1
7 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 40626815
Add-ins are built like that, just like VBA is. The code being associated with the WorkBook instead of Excel makes it easier to send a functional copy of the WorkBook to somebody else.

I cannot say it it would work with an add-in, because I have never done it, but you might want to try the same method that is used in VBA so that code is always available when Excel runs on the station: link your add-in with an Excel file that is located in the XLSTART folder (C:\Users\<UserName>\AppData\Roaming\Microsoft\Excel\XLSTART) on my system.

Excel files that are located there automatically load as invisible in the Excel environment whenever you launch Excel, and their macros are then available in any WorkBook. I suppose that a Workbook linked with an add-in located there would also make its content available.
0
 

Author Comment

by:aaci1
ID: 40630488
Thanks for your reply,
do you know how can I link my add-in with a Excel File ?

Currently In vb.net, I created the menu of my add-in in the OnConnection event of my .dll. In the OnStartupComplete event I open a specific workbook and the menu and its fonctionnality are automatically associated with it. However, I added others workbooks in this event, but the link seems to be broken for these others workbooks and the add-in menu just don't react.

I tried to put my first workbook in the directory you mentioned, but as I said this workbook is open on the OnConnection event of my .dll. In fact the Add-in is this .dll (I think, I'm not the original author).

So maybe if I can link my .dll to the Excel file (my first workbook) the problem will be resolve. Do you know how can I do that ?
Thanks.
0
 
LVL 40
ID: 40631124
Sorry, I do not have much expertise with Office Add-Ins. If fooled around a bit with them, but in my opinion, although I extremely prefer VB.NET over VBA, I decided to still do my stuff in VBA. It makes it easier to move the files around and e-mail them.

I was simply giving you advice as a VBA programmer, who uses the XLSTART folder as a way to have a collection of tools that are always available once Excel is started. I was under the impression that the add-ins were linked to a file when you created them. So I do not know how to do it once both the dll and the file already exist.

Hoping somebody else will be able to help you.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:aaci1
ID: 40631146
OK thanks for your advice, I will wait for someone else.
Thanks !
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 40674228
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40724617
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Spacing Anomaly 4 23
VBA Help 18 44
EXCEL formual to calculate Quarter 6 28
Time difference between dates without weekend 16 17
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question