LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default What's wrong with this picture??

Maybe I'm missing something, but this should be working...

Private WithEvents objCommandBarButton As CommandBarButton

Private Sub Workbook_Open()
Dim obkCommandbars As CommandBars
Dim objCommandBar As CommandBar
Dim objCommandBarControl As CommandBarControl

' Create a menu command on the "Tools" menu.
objCommandBars = Me.Application.CommandBars("Tools")
objCommandBar = objCommandBars.Item("Tools")

' Make sure menu command doesn't already exist.
For Each objCommandBarControl In objCommandBar.Controls
If objCommandBarControl.Caption = "Perform Metric conversion..."
Then
objCommandBar.Controls.Item("Perform Metric
conversion...").Delete
End If
Next objCommandBarControl

objCommandBarButton = objCommandBar.Controls.Add(msoControlButton)

With objCommandBarButton
.Caption = "Perform Metrics Conversion..."
.Style = msoButtonCaption
.Tag = "Perform Metrics Conversion..."
.OnAction = "!<Magic_Metrics.Connect"
.Visible = True
End With
End Sub

Thanks,
Jody W
 
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
Connect a number to a picture bank and import that picture to exce Dennis Hedo Excel Discussion (Misc queries) 1 March 22nd 10 02:17 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
insert a picture in to a comment but picture not save on hard disk Pablo Excel Discussion (Misc queries) 0 February 21st 07 03:48 PM
What's wrong with this picture Jennifer Excel Programming 1 April 28th 05 09:08 AM
What's wrong with this picture? VBA Date code.. mriley Excel Programming 2 October 17th 03 05:56 PM


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