View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Josh Sale Josh Sale is offline
external usenet poster
 
Posts: 177
Default What's special about iRibbonControl?

Thanks Peter.

The Baarns site seems to be up now and I read the white paper. I searched
for but couldn't find the CallCompileNSave routine referenced in the white
paper.

My plate is full right now, but when I have a chance, I'll try your approach
to handling compilation.

Thanks,

josh




"Peter T" <peter_t@discussions wrote in message
...
Hi Josh,

Go figure!


My strategy of slight delay into XL2007 was to shamelessly wait whilst the
likes of you others do all the figuring and save me a whole bunch of time
<g

So are you saying that running a procedure in each module of the add-in
causes each module to be completely compiled but without compile error
checking taking place?


No. As I understand, in a fresh clean project with no code ever run, when
you run one or two procedures in a module those proc's are fully compiled
together with other some other stuff in the module, such as the location
of
other proc's and module level variables, also dependencies to proc's in
other modules. The "as is" extent of compiled code is saved with the
project
(also to avoid other garbage only run once to compile as necessary before
saving & distributing).

So doing what I described doesn't fully compile the project. However
typically I don't notice any difference in execution speed between
partially
and fully compiled. In any case any difference would only exist the first
time code was run in a session, once an uncompiled proc' has run it
remains
compiled for the rest of the session.

A lot of my understanding was based on a very old and possibly out of date
white paper by Don Baarns. Unfortunately his site no longer appears
active,
not sure if that's temporary or permanent. However if you paste this link
into Google and select "Cached" you can still read it.

http://archive.baarns.com/excel/develop/vbaperfm.asp

Apart from the above the point re catering for different versions, is if
later version code has not been compiled its existence in the project
shouldn't cause a problem in an earlier version, providing of course that
code is only called subject to app.version. I think it's also worthwhile
placing such code in the last inserted module.

It would though be a good idea to do a full compile in XL2007 merely as an
error check, and similar in each earlier version commenting out any later
stuff. Then do the partial compile in a 'clean' project in the earliest
version before distributing.

Finally just to re-iterate, all this is only relevant for a file that's
not
going to be saved by a user in a later version and subsequently in an
earlier version, typically that means an addin not an xls.

Regards,
Peter T