Solved

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

Posted on 2015-02-23
7
75 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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!

 

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 47

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

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!

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

749 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