Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default .XLA's Code Not Available?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default .XLA's Code Not Available?

On May 29, 9:27 pm, "Norman Jones"
wrote:
Hi Pete,

there is only one Intermediate window).


That's how it seems - since prior commands that I've typed in to the
window persist whether I'm coming to the window from ABC.xls or
the .XLA.

But it acts differently depending on whether I invoke it from ABC.xls
or the .XLA.

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.


I tried the Reference approach - and Excel allowed me to set the ref.
But it still doesn't recoginize the Sub when I go to the Immediate
window from ABC.XLS.

I'm 99% sure I wasn't having this problem several weeks ago when I
consolodated all my code into a .XLA (and then, foolishly, moved it
back to the .XLS...) - and I don't know enough to have been setting a
reference or anything at that time.... all I was doing was having
both .XLS and .XLA open at the same time.

So my money's still on Yours Truly doing something dumb.

But what?


Could the method of importing the code into the .XLA have anything to
do with it? When I exported, the qualifier defaulted to .CLS and I
changed it to .BAS.... and then imported the .BAS text files into
the .XLA.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to cylce through all the open .xla's as well as the .xls' pinkfloydfan Excel Programming 8 April 2nd 07 11:41 AM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM
Saving variables in XLA's Paul Excel Programming 2 July 9th 04 07:25 PM


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"