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
 
Tommygun your example has Test Menu and underneath that Test Menu Item. In my example i have another submenu after that. How can you work out the index number or caption to be able to disable some of these.

Where i havn't got any popupcontrols its possible to do it like this...
For Each ctrl In Application.CommandBars("mybar").Controls
If ctrl.Index = 1 Then
ctrl.Enabled = False
and the rest

But this won't work where there are popcontrols and can't seem to find a way to find the index or caption to enable/disable the controls.

please help.

ishi
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Not exactly sure what you mean? :unsure: Are you saying that you want to disable a control within a sub-menu? I do this on a daily basis and can send you a file that might get you going in the right direction.
 
Upvote 0
firstly the answer is yes to your question.

For example, if you look at the worksheet menu bar in excel you can see File as the first control. When you click that it gives you further menu options underneath i.e. Print Area which then pops up another menu. Basically mine is constructed like this. The thing i want to do is say disable Set Print Area.

Hope this is better.

ishi
 
Upvote 0
Here's how you would do your example. Maybe it will give you the structure you need for your menu...
Code:
Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Print Area").Controls("Set Print Area").Enabled = False
 
Upvote 0
That was exactly what i was looking for. If you were in the UK I would definitley buy you a beer or 2. Thanks enormously.

ishi
 
Upvote 0
No problem.
beerchug.gif
 
Upvote 0
just one other question. Is it possible to copy over the custom toolbar onto someone else's machine if it is not created in code. The application is on a network server but the toolbar does not appear on anyone else's machine but mine.

ishi
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top