Hi guys,
Question:
------------
--> Is there a way to tell an excel session not to record settings when closing? <--
Explanations:
----------------
I have a first add-in, AddIn1, which creates a submenu, say 'Run AddIn2', in the xl Tools menu.
When this menu is clicked:
- it opens a separate session of Excel, say session2.
- it loads the addin called AddIn2 in this new session of Excel.
Now in this new session, when AddIn2 is loaded, it makes many changes to the Excel environment: changing settings in the Options dialog, changing toobars, menus... for its specific use.
Concurrently the user may or may not have closed the first excel session and may or may not have opened new Excel sessions.
Problem:
-----------
When Excel closes, it records the latest settings: changes in the Options dialog, changes in toobars, menus,...
So, if session2 of excel is the last one to be closed, it will save these settings.
--> this is what i am trying to prevent.
So the main question is:
--> Is there a way to tell an excel session not to record settings when closing? <--
Ideas:
-------
1 - Save all changes addin2 makes to the Excel environment and restore them before closing. Too many changes and i am not sure yet that everything can be reversed 100%.
2 - Before closing, addin2 in session2 creates a new excel session, say session3.
Since session2 has not been closed yet, session2's settings have not been saved yet, therefore the session3 will open with the old settings. Then session2 closes recording its settings and session3 closes overwritting with its settings.
But how to make sure session3 closes right after session2 so that session3's settings becomes the default ones.
3 - Have session1 open session2 of excel with the Safe switch (/s) which launches excel with no addin, with the default toolbars (when excel was set up), then the code of addin1 in session1 loads addin2 in session2.
However, i am not completely sure what Safe mode does.
At least, it doesn't seem to record settings when closing.
Is that true?
Does xl lacks functionality in safe mode or is there things that cannot be done in that mode (besides the non-loaded usual addins)?
4 - Any other ideas are very welcome.
Thank you,
Regards,
Sebastien
by: sebastienmPosted on 2004-07-27 at 23:54:26ID: 11653986
Actually, with idea3 (/s switch), excel prompts the user for his name as it does right after installation. And since excel doesn't load any addin dur to the switch, i suppose no code can be ran to prevevnt that. So this idea won't work.
Sebastien