Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Empty custom toolbar

Hello


I created an excel template file haveing some macro
functions. Then created a custom toolbar and assign
macroes to the buttons.
Now when I copy the template to any other machine and open
the template , the empty toolbar is displyed. the macro
code still exist but buttons are not displayed.

Regards
Ashish
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Empty custom toolbar

I suggest that the file creates its own tool bar usibng
the auto_open or workbook_open event, and removes th ebar
with the close events. that way the app controls the bar.

here's some example code that I sent in an earlier mail.
place in a standard modle. call the AddMenu proc from the
open event and call the killmenu proc from the colse
event.


Sub AddMenu()

Dim ctrlMain As CommandBarPopup
Dim ctrlItem As CommandBarControl
Dim ctrlSubItem As CommandBarButton

KillMenu

Set ctrlMain = CommandBars("Worksheet Menu
Bar").Controls.Add _
(Type:=msoControlPopup, _
temporary:=True)

With ctrlMain
.Caption = "&Analysis"

Set ctrlItem = .Controls.Add
(Type:=msoControlButton)
With ctrlItem
.Caption = "&Initialse Test"
.OnAction = "subInitialise"
End With
Set ctrlItem = .Controls.Add
(Type:=msoControlPopup)
With ctrlItem

.Caption = "&Explore Test"
.BeginGroup = True

Set ctrlSubItem = .Controls.Add
(Type:=msoControlButton)
With ctrlSubItem
.Caption = "Type &1"
.OnAction = "sub1"
End With
Set ctrlSubItem = .Controls.Add
(Type:=msoControlButton)
With ctrlSubItem
.Caption = "Type &2"
.OnAction = "Sub2"
End With
End With
Set ctrlItem = .Controls.Add
(Type:=msoControlButton)
With ctrlItem
.Caption = "&Plan Test"
.BeginGroup = True
.OnAction = "sub3"
End With
End With

End Sub
Sub KillMenu()
Dim cmdbar As CommandBar
On Error Resume Next
Set cmdbar = CommandBars("Worksheet Menu Bar")
cmdbar.Controls("&Analysis").Delete
On Error GoTo 0

End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hello


I created an excel template file haveing some macro
functions. Then created a custom toolbar and assign
macroes to the buttons.
Now when I copy the template to any other machine and

open
the template , the empty toolbar is displyed. the macro
code still exist but buttons are not displayed.

Regards
Ashish
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA custom toolbar donwb Excel Discussion (Misc queries) 0 December 28th 09 01:15 AM
Custom Toolbar Enyaw Excel Discussion (Misc queries) 1 October 9th 09 01:10 PM
Custom Toolbar user Excel Discussion (Misc queries) 1 March 17th 09 05:33 AM
Empty custom toolbar ashish Excel Programming 0 August 8th 03 06:39 AM
saving toolbar buttons on custom toolbar Paul James Excel Programming 12 August 6th 03 08:28 AM


All times are GMT +1. The time now is 07:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"