What I've been able to determine is that your code should work if the
commandbar was 'added' using VBA. If it was created via the UI as a
custom toolbar via the 'Customize' dialog then setting the State has no
effect. Since I have both scenarios set up, I remember why I chose to
change the Caption instead of messing around with MsoButtonState.
So then, if you want your code to work you have to build the commandbar
from scratch at startup. This means you'll also have to remove it at
shutdown. To do either will require code in the module behind
ThisWorkbook using Workbook_Open and Workbook_BeforeClose events
OR
in a standard module (possibly named "mOpenClose") using Auto_Open()
and Auto_Close() subs.
I assume the macros are stored in PERSONAL.XLS, but if this isn't the
case and you keep them in another workbook that opens whenever Excel
starts (ie: "MyMacros.xl_") then the code to build/delete your
commandbar should go there.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc