![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 232
|
Hi, I posted a question a few days ago about getting custom toolbars to stick to workbooks when they are emailed out to different people.
I was advised to go and attach the toolbar, which I did, but it still isn't sticking when emailed to users, and doesn't appear in their custom toolbar list either. Is there some code I could include to make the toolbar be there for everyone? Cheers Matt |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
You can create toolbars 'on-the-fly' in VBA. Something like this should get you going. It's copied directly from a simple add-in I wrote:-
Code:
Private Sub Workbook_Open()
'Attempt to delete any menu just in case Excel was
'closed down improperly or crashed.
Dim Con As CommandBarControl, ConPop As CommandBarPopup
Dim ComBut As CommandBarButton
For Each Con In Application.CommandBars("Tools").Controls
If Con.Caption = "C&lean Active Workbook" Then
Con.Delete
End If
Next
Set ComBut = Application.CommandBars("Tools").Controls.Add(msoControlButton)
ComBut.Caption = "C&lean Active Workbook"
ComBut.OnAction = "CleanBook"
ComBut.FaceId = 59
End Sub
D |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|