Hi Dave,
Sorry to take so long to respond, I’ve been a little busy trying to get XLXP working.
I’ll start at the beginning and hopefully make it a little less confusing.
I have a file called MMLoad.xls which has the ISAddin property found in the VBE under ThisWorkbook set to True. This file is stored in the XLStart directory and loads when Excel is launched. The XLStart directory also normally contains the personal.xls workbook that is used to store peoples custom Macro’s, Personal.xls is also loaded at launch time and can be viewed through Windows > Unhide. MMLoad.xls however cannot be viewed through Windows > Unhide as it is seen by Excel as being an Addin even though it has an .xls extension.
MMLoad.xls controls the loading and unloading of my main code repository (MM.xls), MMLoad.xls also audits the users machine for username, operating system 95 / 98 / 2000 / XP / NT, Excel version 97 / 2000 / XP, connection status LAN / Dial Up / Stand Alone / ADSL / ISDN etc. When these parameters are defined a VBS (Visual Basic Script) is run external to Excel that brings the MM.xls addin into the XLStart directory and opens it with a password. MM.xls is also a Workbook with the IsAddin property set to true, it is also password protected which essentiall makes it a password protected addin that can only be accessed through MMLoad.xls
MMLoad.xls also audits the local C drive for the latest version of a package of Templates and Addins that I have developed and if a later version exists on the network it will download it external to Excel through a VBS.
All this as confusing as it sounds is in place due to security requirements. So to answer your question simply the *.xls Addin is loaded at launch time.
The problem I was having was that at load / launch time the code contained in ThisWorkbook Workbook_Open would not trigger. I tried many various combinations of coding from having the code I needed to run in Worbook_Open through to calling it from a separate module with Application.Run “My Macro”. Nothing was working, I has tried all various levels of security. I checked my XLStart folder location and discovered there was another one under My Documents folder (just like you said), I put MMLoad.xls in there and still the code would not trigger at startup, it would however trigger if I manually launched the file after Excel was running but still would not run at load time.
It dawned on me that I had had a similar problem before when running a macro and jumping to another before the first one had finished. I solved that problem by using OnTimeNow so I recoded my Workbook_Open code to Application.OnTime Now + TimeValue("00:00:01"), "My Macro". Hey presto it worked, I can only assume that having the code running while Excel was opening caused some kind of conflict that would open freeze up Excel. By using the delay of OnTime Now I was able to resolve the conflict by giving XLXP time to launch completely.
I am now faced with a new problem however in that the location for the XLStart folder is variable based on user name i.e C:\My Documents\watermaj\application\Microsoft\xlstart with watermaj being the variable for every different machine. I’m 90% of the way to resolving this by ripping the username from the registry as a variable and passing it to a hardcoded string.
Anyway I hope that serves to clarify my complex security and Addin loading process a little. If anyone else is having similar problems hopefully they can learn from my experience.
AJW