SIMPLE way to call code in one XLA from another?

M

Maury Markowitz

I'm trying to greatly reduce the amount of code that is copied into
various VBA containers but is otherwise identical. This includes
things like calculating holidays, figuring out who the user is, and
various utilities like "WorksheetExists". I've given up on trying to
make a truly universal one that will work in Excel and Access (am I
missing something?) so for now I'm concentrating on Excel.

I have about 20 modules in one huge code library. I want to break this
down, and move all the truly generic utility code into a new XLA
called, oddly enough, "Generic". This code rarely changed. That code
will then be called from another broken-out library called
"accounting". This code changes much more often.

The problem is that, from what I can see, subs and functions in one
XLA are invisible to another. I have seen code for calling it using
RUN, but that is extremely ugly. Is there some other way to more
directly call another module, like...

Generic.WorksheetExists("myWorksheet")

Maury
 
B

Bob Phillips

Set a reference in Tools>References to the other XLA, It is then a directly
callable procedure.
 
M

Maury Markowitz

Set a reference in Tools>References to the other XLA, It is then a directly
callable procedure.

Can this be done at runtime? IE, can References be added on-demand?
That would be a good solution, as I could add them from a known list
in the books OnOpen.

Maury
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top