Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
.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
Posted to microsoft.public.excel.programming
|
|||
|
|||
.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
Posted to microsoft.public.excel.programming
|
|||
|
|||
.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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want to cylce through all the open .xla's as well as the .xls' | Excel Programming | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming | |||
Saving variables in XLA's | Excel Programming |