Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.xlam add-in is not being referenced in Workbook Code

Posted on 2016-09-01
6
Medium Priority
?
45 Views
Last Modified: 2016-09-01
Having difficulty referencing code from an add-in.
Created a Personal.xlsb workbook and then a VBA_CODE_Tools.xlam add-in to store commonly used functions (LastDataRow, etc.). These are installed.
The routines were copied from a .xlsm workbook over to VBA_CODE_Tools.xlam and then deleted from the .xlsm workbook.  When running a newly created Sub, and referencing lRow = LastDataRow, the code just moves to the next line with a "LastDataRow is Empty" when hovering over it.
If I move the Function back to the .xlsm workbook, it runs correctly.

Even installed a Workbook_Open routine to reference the add-in.  What else am I missing?

Cook09
0
Comment
Question by:Cook09
6 Comments
 
LVL 27

Assisted Solution

by:ProfessorJimJam
ProfessorJimJam earned 400 total points
ID: 41780189
Perhaps the codes on the xlsm. Refers to "ThisWorkbook" rather than "Activeworkbook"

Check if you had used Thisworkbook
0
 
LVL 22

Accepted Solution

by:
Roy Cox earned 1600 total points
ID: 41780223
Have you installed the addin correctly? Read this

You might need to set a reference to the addin using Tools->References
Screenshot-2016-09-01-17.40.21.png
It might help to change the addin's VBA Project Name - Tools-> VBA Project properties

Screenshot-2016-09-01-17.43.06.png
Also, the Professor's suggestion is important, many times that is neglected or not understood.
0
 
LVL 22
ID: 41780400
so we can see how your functions are constructed, please post the code you are using for LastDataRow, thanks
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Cook09
ID: 41780509
Experts,
It seems that Roy had the best solution in my case.  It began to work when the VBAProject name was changed and then checked in the References section.

Thanks
Cook09
2016-09-01_14-28-42.jpg
0
 

Author Closing Comment

by:Cook09
ID: 41780513
Thanks...
0
 
LVL 22

Expert Comment

by:Roy Cox
ID: 41781034
Pleased to help
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

971 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