Solved

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

Posted on 2016-09-01
6
33 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 18

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 18

Expert Comment

by:Roy_Cox
ID: 41781034
Pleased to help
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 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