Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 123
Default customized toolbar issue

i have created worksheet with a customize toolbar with assigned macros to the
buttons.

This file will be a master file. Users will open, save as using a different
name.

however, when i updat the master with the toolbar in the master file and
save, other users cannot see my button changes when they open the master.

we tried to delete the toolbar from the workbook and re-attach the latest
toolbar and yes, the user sees the latest toolbar howeverthe assigned macros
are still referring to an older versin of that file.

help anyone? please...

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default customized toolbar issue

Tami,

Assuming Pre-XL 2007, since you say toolbar and not ribbon...

The best option is to create the commandbar (toolbar) on the fly, when the
workbook is
opened, and delete the commandbar when the workbook is closed. Follow these
instructions and example code.

In the workbook's Thisworkbook object code module, place the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DeleteCommandbar
End Sub

Private Sub Workbook_Open()
CreateCommandbar
End Sub

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
On Error GoTo NotThere
Application.CommandBars("My Bar").Visible = True
Exit Sub
NotThe
CreateCommandbar
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
On Error Resume Next
Application.CommandBars("My Bar").Visible = False
End Sub

In a regular code module, place the following:

Dim myBar As CommandBar
Dim myButton As CommandBarButton

Sub CreateCommandbar()

On Error Resume Next
DeleteCommandBar

Set myBar = Application.CommandBars.Add("My Bar")
With myBar
..Position = msoBarTop
..Visible = True
..Enabled = True
Set myButton = .Controls.Add(Type:=msoControlButton, ID:=23)
With myButton
..Caption = "Hello"
..Style = msoButtonIcon
..FaceId = 137
..Enabled = True
..OnAction = "SayHello"
End With
End With

End Sub

Sub DeleteCommandBar()
'Delete the commandbar if it already exists
On Error Resume Next
Application.CommandBars("My Bar").Delete
End Sub

Sub SayHello()
MsgBox "Hello there"
End Sub

You can add as many buttons or other menu items as you like.

HTH,
Bernie
MS Excel MVP


"Tami" wrote in message
...
i have created worksheet with a customize toolbar with assigned macros to
the
buttons.

This file will be a master file. Users will open, save as using a
different
name.

however, when i updat the master with the toolbar in the master file and
save, other users cannot see my button changes when they open the master.

we tried to delete the toolbar from the workbook and re-attach the latest
toolbar and yes, the user sees the latest toolbar howeverthe assigned
macros
are still referring to an older versin of that file.

help anyone? please...


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
Customized Toolbar Macro Buttons MSThinksItKnowsBetter Setting up and Configuration of Excel 8 June 1st 08 09:28 AM
Saving customized excel toolbar Roman King New Users to Excel 2 June 6th 07 09:00 PM
Saving customized toolbar and menus Min Excel Discussion (Misc queries) 2 April 13th 07 10:30 AM
How do you keep your toolbar customized the way you set it up? alitanna New Users to Excel 2 May 19th 06 08:20 AM
How can I save a customized Standard toolbar? TD Excel Discussion (Misc queries) 1 March 25th 05 07:06 PM


All times are GMT +1. The time now is 08:24 PM.

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

About Us

"It's about Microsoft Excel"