Solved

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

Posted on 2015-02-23
7
72 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now