Solved

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

Posted on 2016-09-01
6
32 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 25

Assisted Solution

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

Check if you had used Thisworkbook
0
 
LVL 17

Accepted Solution

by:
Roy_Cox earned 400 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 19
ID: 41780400
so we can see how your functions are constructed, please post the code you are using for LastDataRow, thanks
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: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 17

Expert Comment

by:Roy_Cox
ID: 41781034
Pleased to help
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

Suggested Solutions

Title # Comments Views Activity
Vb.net dynamic formulas in runtime 11 63
Easy Excel formula needed 4 27
Auto Adjust Percent rate 5 31
VBScript Issues 8 15
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

23 Experts available now in Live!

Get 1:1 Help Now