Solved

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

Posted on 2015-02-23
7
70 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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 45

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

747 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

13 Experts available now in Live!

Get 1:1 Help Now