• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 112
  • Last Modified:

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

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
aaci1
Asked:
aaci1
2 Solutions
 
Jacques Bourgeois (James Burger)Commented:
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
 
aaci1Author Commented:
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
 
Jacques Bourgeois (James Burger)Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
aaci1Author Commented:
OK thanks for your advice, I will wait for someone else.
Thanks !
0
 
CodeCruiserCommented:
0
 
Martin LissRetired ProgrammerCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now