#1   Report Post  
cassy01
 
Posts: n/a
Default Own Menu-Bar ?


is it possible to make your own menu-bar accross the top of the
worksheet, getting rid of the one thats there and making your own ????

so in other words i open this file up on any computer and it shows my
customized menu and when i open up another worksheet it will go back to
normal.

so the menu bar will only work on that one workbook ??

thanks


--
cassy01
------------------------------------------------------------------------
cassy01's Profile: http://www.excelforum.com/member.php...nfo&userid=780
View this thread: http://www.excelforum.com/showthread...hreadid=482753

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Own Menu-Bar ?

You could hide all the existing controls and add your own, like so
Option Explicit

Dim ary
Dim cAry As Long

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
Dim oCtl As CommandBarButton
Dim i As Long

Set oCB = Application.CommandBars(1)
For i = 1 To UBound(ary)
oCB.Controls(ary(i)).Visible = True
Next i
oCB.Controls("Test").Delete
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
Dim oCtl As CommandBarControl


Set oCB = Application.CommandBars(1)
ReDim ary(1 To 1)
cAry = 1
For Each oCtl In oCB.Controls
oCtl.Visible = False
ReDim Preserve ary(1 To cAry)
ary(cAry) = oCtl.Caption
cAry = cAry + 1
Next oCtl
Set oCtl = oCB.Controls.Add(Type:=msoControlButton, temporary:=True)
With oCtl
.Caption = "Test"
.Style = msoButtonCaption
.OnAction = "myMacro"
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"cassy01" wrote in
message ...

is it possible to make your own menu-bar accross the top of the
worksheet, getting rid of the one thats there and making your own ????

so in other words i open this file up on any computer and it shows my
customized menu and when i open up another worksheet it will go back to
normal.

so the menu bar will only work on that one workbook ??

thanks


--
cassy01
------------------------------------------------------------------------
cassy01's Profile:

http://www.excelforum.com/member.php...nfo&userid=780
View this thread: http://www.excelforum.com/showthread...hreadid=482753



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
What is a shortcut menu? Jeffry Excel Discussion (Misc queries) 4 May 4th 09 04:03 PM
Help with drop down menu Jrr6415sun Excel Worksheet Functions 4 July 10th 05 05:58 PM
right click menu excel Jo Vercauteren New Users to Excel 1 May 3rd 05 09:34 PM
What is a Conditional pull down menu? Neil Bhandar Excel Discussion (Misc queries) 2 May 3rd 05 02:55 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM


All times are GMT +1. The time now is 10:26 AM.

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"