Excel Addins

Posted on 2003-02-26
Medium Priority
Last Modified: 2008-01-16
I have written some functions that retrieve data from an Access Database. These work OK.

Because I need to use these same functions in other Excel workbooks I created an XLA addin and opened XLA addin in my file. Everything still works OK, even though there are 2 functions with same name.

I then deleted the code from my workbook leaving only the code in the XLA for the workbook to use. Now it doesn't work. The workbook doesn't recognise the XLA.

I then created a new empty workbook and opening the addin the functions work OK.

Why would the addin work OK in one file and not in the other?

I can get around this by having duplicate code in many workbooks but that is too difficult to maintain.

Any help appreciated.

Question by:glennwaldron
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

Author Comment

ID: 8029655
I have copied all the sheets from the current workbook to a new workbook and they now recognise the addin.

I would still like to know why if there is a reason so I'll leave the question open.
LVL 13

Accepted Solution

cri earned 200 total points
ID: 8047310
Did you compile/save the workbook after deleting the code ?

Problem with Excel is that the VBA accumulates junk in the editing process. There is even a first rate tool available for free: See CodeCleaner in http://www.bmsltd.co.uk/MVP/MVPPage.asp

If you want I can give some links which makes developing of add-ins easier.
LVL 81

Assisted Solution

byundt earned 200 total points
ID: 8133866
I bet your function calls lost their links to the VBA code. If you don't have very many function calls, then select each function call that doesn't work and preface it with the fully qualified reference to the .xla

As an alternative (when you have lots of VBA function calls), you can start with a complete workbook (worksheets & underlying VBA code on module sheets). Then Edit...Move the worksheets to a new workbook. That will link all the VBA function calls to the old workbook. Save the worksheet-free workbook as a .xla and save the VBA-free new workbook as your working copy. Quit Excel. Restart Excel and make the .xla an add-in. Then open the working copy and use the Edit...Links command to send the VBA function calls to the .xla
LVL 11

Expert Comment

ID: 10104191
No comment has been added lately (306 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: split points between cri http:#8047310 and byundt http:#8133866

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --


EE Cleanup Volunteer

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
This video shows how use content aware, what it’s used for, and when to use it over other tools.

765 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