View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych Tim Zych is offline
external usenet poster
 
Posts: 389
Default Making it an AddIn vs adding a Reference?

I *know* this scheme was working two weeks
ago. I had never done it before. Somebody suggested it. I
did it and *bingo* it worked. Definitely wasn't rocket science.


User Defined Functions in an addin do work without a reference if used as
formulas on a worksheet, but VBA-to-VBA require a reference, link or
Application.Run to the XLA as far as I know. Perhaps that is what worked for
you? Or if you linked a Forms command button to a macro in the addin, that
would work too.

My preference is using Application.Run as the linking that occurs with a
reference, and the requirement that workbooks be closed in a particular
order, does not appeal to me. Linking in general has lots of gotchas that I
generally try to steer clear of.

--
Tim Zych
www.higherdata.com
Compare data in workbooks and find differences with Workbook Compare
A free, powerful, flexible Excel utility

"(PeteCresswell)" wrote in message
...
Per RB Smissaert:
For starters, I don't think you need to set any references if the .xla is
loaded as an add-in.
Secondly, the add-in should setup the menu in Excel, so you can see it in
the .xls and
via that menu you can access anything that is needed in the add-in.


This supports my suspicion that I've got something really simple
and basic messed up. I *know* this scheme was working two weeks
ago. I had never done it before. Somebody suggested it. I
did it and *bingo* it worked. Definitely wasn't rocket science.

But then I moved the code back into the .XLS.

Now I've moved it again - back to a .XLA and the .XLS can't
compile refs to routines in the .XLA.

My reason for starting a separate thread was that I believe my
real problem may be around a misunderstanding of exactly what a
"Reference" is vs an "AddIn".



Thirdly, you say you have an .xls and an .xla file. Would it be possible
to
do away
with the .xls and put all in the .xla? I think it will matters simpler.


That's the whole point of my exercise. But there has tb some
communication between .XLS and .XLA bc, for instance, a button
click on the .XLS has to call code in the .XLA.
--
PeteCresswell