Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do you change the Worksheet Menu Bar "icon"?

Hello all,

I can't believe no one has needed to do this, but I googled high and
low and didn't find an answer.

I want to change the icon of the Worksheet Menu Bar in Excel. The
subject has "icon" in quotes because I dropped into win32, found the
HWND of the Worksheet Menu Bar, and did a SendMessage ... WM_SETICON
.... and the icon didn't change, so I am not sure it is the icon of the
menu bar (perhaps the WM_PAINT handler just draws it?).

I feel confident that this can be done, because they hinted at it in
Professional Excel Development (Bullen, Bovey, Green). Actually, it
sounded like they were going to tell you how to do it, but then they
just showed code for changing the main window icon.

Any and all help is appeciated,

Jim Barnett
Software Engineer

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default How do you change the Worksheet Menu Bar "icon"?

Jim,
One way is replace the menu bar with your own custom menu bar.
Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

'--------------------
Sub MakeDuplicateWorksheetMenuBar()
Dim cmdNewBar As Office.CommandBar
Dim cmdCtrl As Office.CommandBarControl
Dim cmdButton As Office.CommandBarButton

'Create the new bar
Set cmdNewBar = Excel.CommandBars.Add(Name:="NewBar", _
Position:=msoBarTop, MenuBar:=False, Temporary:=True)

With cmdNewBar.Controls
' New icon
Set cmdButton = .Add(Type:=msoControlButton)
cmdButton.FaceId = 273

' Duplicate the existing controls
For Each cmdCtrl In Excel.CommandBars(1).Controls
.Add ID:=cmdCtrl.ID
Next
End With

'Hide the old bar and show the new bar
Excel.CommandBars(1).Enabled = False
cmdNewBar.RowIndex = 1
cmdNewBar.Visible = True
End Sub


Sub MakeItRight()
Excel.CommandBars("NewBar").Delete
Excel.CommandBars(1).Enabled = True
End Sub
'--------------------------------



wrote in message
Hello all,
I can't believe no one has needed to do this, but I googled high and
low and didn't find an answer.

I want to change the icon of the Worksheet Menu Bar in Excel. The
subject has "icon" in quotes because I dropped into win32, found the
HWND of the Worksheet Menu Bar, and did a SendMessage ... WM_SETICON
.... and the icon didn't change, so I am not sure it is the icon of the
menu bar (perhaps the WM_PAINT handler just draws it?).

I feel confident that this can be done, because they hinted at it in
Professional Excel Development (Bullen, Bovey, Green). Actually, it
sounded like they were going to tell you how to do it, but then they
just showed code for changing the main window icon.

Any and all help is appeciated,
Jim Barnett
Software Engineer

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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Excel should have a "Change Case..." menu Item like Word!! Octapusgardenintheshade Excel Discussion (Misc queries) 1 November 22nd 05 06:32 PM
CommandBars("Worksheet Menu Bar").Controls("Tools").Enabled = Fals Arturo Excel Programming 3 May 26th 05 05:44 PM
Can't Change Commandbars("Worksheet Menu Bar") Tim[_34_] Excel Programming 2 March 3rd 04 04:00 PM


All times are GMT +1. The time now is 08:17 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"