Solved

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

Posted on 2016-09-01
6
39 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
[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
6 Comments
 
LVL 26

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 19

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

Expert Comment

by:Roy_Cox
ID: 41781034
Pleased to help
0

Featured Post

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!

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

710 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