custom toolbar options

ishi

Board Regular
Joined
Apr 3, 2003
Messages
126
I have created my own toolbar and just placed it at the top. What i would like to do is have this hidden or disabled on open of workbook. Also i have a login form that loads on open of the workbook and when the users enter their logins (not set up yet) depening who they are can have certain buttons enabled on my toolbar. After the login process have the toolbar unhidden.

Any help much appreciated.

Thanks,

ishi
 

ishi

Board Regular
Joined
Apr 3, 2003
Messages
126
I'll stick with excel for a while. Enough confusion here but thanks to you guys life is somewhat less painful :)

ishi
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

ishi

Board Regular
Joined
Apr 3, 2003
Messages
126
just another question is it possible to change the background colour of the custom toolbars from the rather boring grey.

Thanks,

ishi
 

TommyGun

MrExcel MVP
Joined
Dec 9, 2002
Messages
4,202
Nope (at least not in XL 97). This is set by your Windows color schemes.
 

TommyGun

MrExcel MVP
Joined
Dec 9, 2002
Messages
4,202

ADVERTISEMENT

Don't have that here, or I would check, but I don't think you can do that with 2000 either.
 

ishi

Board Regular
Joined
Apr 3, 2003
Messages
126
I have somewhat got hang of the toolbar apart from being able to have many buttons under one button (if that makes sense). For example in excel under file you have new-open-close all under file. This is what i am trying to create but not very successfully.

another suggestion please.

ishi
 

TommyGun

MrExcel MVP
Joined
Dec 9, 2002
Messages
4,202

ADVERTISEMENT

If you are trying to create a "menu" on a toolbar, then you have to use the PopUp control and then add controls to it.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> CreateToolbar()
    <SPAN style="color:#00007F">Dim</SPAN> TB <SPAN style="color:#00007F">As</SPAN> CommandBar
    <SPAN style="color:#00007F">Dim</SPAN> MyMenu <SPAN style="color:#00007F">As</SPAN> CommandBarPopup
    <SPAN style="color:#00007F">Dim</SPAN> MyMenuItem <SPAN style="color:#00007F">As</SPAN> CommandBarButton

    <SPAN style="color:#00007F">Set</SPAN> TB = Application.CommandBars.Add(Name:="TestThis")
    <SPAN style="color:#00007F">Set</SPAN> MyMenu = TB.Controls.Add(Type:=msoControlPopup)
    <SPAN style="color:#00007F">Set</SPAN> MyMenuItem = MyMenu.Controls.Add(Type:=msoControlButton)

    MyMenu.Caption = "Test Menu"

    MyMenuItem.Caption = "Test Menu Item"

    TB.Visible = <SPAN style="color:#00007F">True</SPAN>

    <SPAN style="color:#00007F">Set</SPAN> MyMenuItem = <SPAN style="color:#00007F">Nothing</SPAN>
    <SPAN style="color:#00007F">Set</SPAN> MyMenu = <SPAN style="color:#00007F">Nothing</SPAN>
    <SPAN style="color:#00007F">Set</SPAN> TB = <SPAN style="color:#00007F">Nothing</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>
 

ishi

Board Regular
Joined
Apr 3, 2003
Messages
126
thanks tommygun, but i think i have what i am looking for. When you go to view-toolbars-customize and create a new one then under command the middle tab you can select New Menu at the bottom and this way i can have different sections under a menu. Hope this makes sense.

Although i guess the referencing will be different.

ishi
 

Watch MrExcel Video

Forum statistics

Threads
1,108,860
Messages
5,525,241
Members
409,637
Latest member
LT TASL

This Week's Hot Topics

Top