Solved

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

Posted on 2016-09-01
6
29 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 18
ID: 41780400
so we can see how your functions are constructed, please post the code you are using for LastDataRow, thanks
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
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 Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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.

705 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

15 Experts available now in Live!

Get 1:1 Help Now