I've a sneaking suspicion I may have worked it out.
In non-technical terms this is what I think is happening ...
FRED is a module.
Within FRED there is an AUTO_OPEN procedure wheich checks a flag on the spreadsheet and if the flag is "Y" it then removes the module FRED and imports FRED from a file (the location of which is also specified on the spreadsheet).
I think that FRED is being executed so when FRED is imported, it cannot be called FRED as FRED is executing at that timem so Excel helpfully calls it FRED1.
The code, in case it helps people much more skilled than I, I use to do this is as follows ...
The variables used above are ...
vReloadCodeOnStartup = the flag to decide whether new load is required.
vFileContainingModule = The file name where the new version can be found
vModuleToLoad = the module name (e.g. FRED)
ANY comments on this welcome.
BTW - the module is not really called FRED (in case it matters), I've changed the name to protect company confidentiality.
I guess I could rename the "old" module prior to removal - would that do it?
If so - how would I rename it?
Again - thanks very much for your help.
Bookmarks