ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling Add-In subroutines from other modules (https://www.excelbanter.com/excel-programming/289969-calling-add-subroutines-other-modules.html)

sclark

Calling Add-In subroutines from other modules
 
I have a bunch of common subroutines that I have placed in an Add-In module. This module is available whenever I open Excel, but I cannot reference the subroutines in the Add-In module, from other workbook modules. How is this done?

Steve

Tom Ogilvy

Calling Add-In subroutines from other modules
 
With your workbook that needs to reference it as the active project,

in the VBE, Tools=References and select the ADDIN

--
Regards,
Tom Ogilvy

"sclark" wrote in message
...
I have a bunch of common subroutines that I have placed in an Add-In

module. This module is available whenever I open Excel, but I cannot
reference the subroutines in the Add-In module, from other workbook modules.
How is this done?

Steve




sclark

Calling Add-In subroutines from other modules
 
Tom, I do have the add-in, and I can see it in the
project list with any workbook i open. However, if I try
to call a subroutine that is in the Add-In, FROM another
workbook module, it doesn't find the routine. If I copy
that routine into the workbook module I am calling from,
it works fine.

Steve
-----Original Message-----
With your workbook that needs to reference it as the

active project,

in the VBE, Tools=References and select the ADDIN

--
Regards,
Tom Ogilvy

"sclark" wrote in

message
...
I have a bunch of common subroutines that I have placed

in an Add-In
module. This module is available whenever I open Excel,

but I cannot
reference the subroutines in the Add-In module, from

other workbook modules.
How is this done?

Steve



.


Tom Ogilvy

Calling Add-In subroutines from other modules
 
I understand and if you create a reference to the addin as I described, then
it will find the routine.

If you don't want to create the reference, then use application.Run see
help for details.

--
Regards,
Tom Ogilvy

"sclark" wrote in message
...
Tom, I do have the add-in, and I can see it in the
project list with any workbook i open. However, if I try
to call a subroutine that is in the Add-In, FROM another
workbook module, it doesn't find the routine. If I copy
that routine into the workbook module I am calling from,
it works fine.

Steve
-----Original Message-----
With your workbook that needs to reference it as the

active project,

in the VBE, Tools=References and select the ADDIN

--
Regards,
Tom Ogilvy

"sclark" wrote in

message
...
I have a bunch of common subroutines that I have placed

in an Add-In
module. This module is available whenever I open Excel,

but I cannot
reference the subroutines in the Add-In module, from

other workbook modules.
How is this done?

Steve



.




sclark

Calling Add-In subroutines from other modules
 
Tom, Thanks for the reply. I will try that. I misunderstood, thinking that I had already referenced the module as an Add-In.

Steve

sclark

Calling Add-In subroutines from other modules
 
Still don't get it. The addin (my custom Add-In) which is visible in the project window for ANY workbook I have open, is not in the list of references, so I cannot select it via Tools/References menu. I can try the application run as well. Any thoughts

Steve

Chip Pearson

Calling Add-In subroutines from other modules
 
Steve,

With the add-in loaded in VBA, go to the Tools menu and choose
VBA Project Properties. In that dialog, give the project a
unique name, like "MyAddInProject" or something. Then, open
workbook which will reference the add-in project. Go to the Tools
menu, choose References, and put a check next to the add-in's
project (not file) name.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"sclark" wrote in message
...
Still don't get it. The addin (my custom Add-In) which is

visible in the project window for ANY workbook I have open, is
not in the list of references, so I cannot select it via
Tools/References menu. I can try the application run as well.
Any thoughts?

Steve





All times are GMT +1. The time now is 11:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com