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: 219
Default command bar name not recognized

I've cobbled together the following code to create a toolbar everytime a
certain spreadsheet opens:

Sub CreateOSIMenubar()

Dim vMacNames As Variant
Dim vCapNames As Variant
Dim vTipText As Variant

Call RemoveOSIMenubar

vMacNames = "OSILogInsertRow"
vCapNames = "OSILogInsertRow"
vTipText = "Add Row"

With Application.CommandBars
.Add
.Name = vMacNames <----- Compile Error: Method or Data Member not found
.Left = 200
.Top = 200
.Protection = msoBarNoProtection
.Visible = True
.Position = msoBarTop
.Left = CommandBars("FormatDGB").Left + CommandBars("FormatDGB").Width
.RowIndex = CommandBars("FormatDGB").RowIndex
End With
With CommandBars(vMacNames).Controls.Add(Type:=msoContr olButton)
.OnAction = "'" & ThisWorkbook.Name & "'!" & vMacNames
.Caption = vCapNames
.Style = msoButtonCaption
.TooltipText = vTipText
End With
End Sub

Doesn't recognize the name variable or something. Any ideas?
Thanks
 
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
UDF Not recognized Rookie_User Excel Worksheet Functions 3 January 29th 10 10:16 PM
Excel not recognized using "open with" command on text files mrwawa Excel Discussion (Misc queries) 1 March 30th 09 05:17 PM
One cell isn't recognized? LiveUser Excel Discussion (Misc queries) 2 February 14th 08 09:07 PM
Add-In not Recognized naive14 Excel Programming 2 May 11th 07 09:10 PM
Command not recognized WLMPilot Excel Worksheet Functions 2 April 29th 05 04:08 PM


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