Thread: Import module
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Import module

Charlotte E brought next idea :
Is there some reason the module can't be included in the project and only
use its code under certain conditions?


It contains XL2007 code, which won't complie under XL2003 - so, I check for
Application.Version, and import the module if Version is 11.

Works like a charm :-)
Unless if project is hidden from viewing :-(

CE

"GS" wrote in message ...
Charlotte E wrote :
I need my VBA to import a module depending on certain conditions.

Problem is that the project is 'hidden from viewing' with a code, and
apparrently this also blocks for modules to be imported!

Is there a way to temporary unlock the project, import the module, and
then protect the project again?

I'm not talking about cracking the project - the code is known...

...just need to temporary allow for a module to be imported by VBA code
(the importing code, I already know :-)


Thanks in advance...


Is there some reason the module can't be included in the project and only
use its code under certain conditions?

-- Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc



Ok. So what I do is make a 'plugin' addin to my addin, so if your
'core' addin detects =XL12 then open the 'plugin' addin and have its
menus added to yours. This will allow you to use Workbooks.Open as
normal, and you can store the xlam in the same folder as your xla.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc