View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default .XLA's Code Not Available?

Hi Pete,

When the XLA is the active project, you
can call its functions directly from the
Immediate window (BTW, there is only
one Intermediate window).

To call the addin when another project
is active - say your ABC workbook, you
would need to use the Application's Run
method.

Alternatively, if you set a reference in your
ABC workbook to the xla, the functions
and subs will be avqailable in to you as if
they were native to the ABC workbook.



---
Regards.
Norman


"PeteCresswell" wrote in message
...
I started this in another thread, but now it seems unrelated to that
thread.

I've got what seems tb a valid .XLA file (has the little red square in
the upper right hand corner of it's icon, was created by doing a "Save
As" and specifying .XLA).

When I open a workbook - let's call it "ABC.XLS" and then open
the .XLA; the code in the .XLA is visible via Project Manager.

When I open up a .XLA code module and then an Immediate window, I can
execute code in the .XLA.

But when I open up one of the .XLS's modules and then and Immediate
window Excel pops a "Compile error: Sub or Function not defined"
dialog.

I think the .XLA is valid bc with Tools | AddIns | Browse I can add it
to the list of ABC's Add-Ins.

But even with it added to the AddIn list (as opposed to just being
opened at the same time) that code is not available in an Immediate
window opened from one of ABC's modules.

Seems to me like I had something like this working some weeks back
with no problems.

Clearly I'm doing something dumb.

But what?