PC Review


Reply
Thread Tools Rate Thread

Adding a divider to an add-in using vba in excel 2007

 
 
test_52
Guest
Posts: n/a
 
      7th May 2008
I have done some research and thought that I had this figured out, but it is
not giving me the result that I am looking for. I am trying to add a divider
to a drop down list between different macros. I thought this was done by the
BeginGroup property, but it is not adding the divider. I have posted a
section of my code below. Can anyone tell me if I am going about this wrong?
Any help would be great. Thanks, Jason



Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup,
temporary:=True)
With cmdBarMenu
.Caption = "Tools"
.Tag = "JJT"
End With

Set cmdBarMenuItem = cmdBarMenu.Controls.Add(Type:=msoControlButton)
With cmdBarMenuItem
.Caption = "Merge"
.OnAction = "MergeCells"
.Tag = "JJT"
.FaceId = 798
End With

cmdBarMenu.BeginGroup = True

Set cmdBarMenuItem = cmdBarMenu.Controls.Add
With cmdBarMenuItem
.Caption = "Unmerge"
.OnAction = "UnmergeCells"
.Tag = "JJT"
.FaceId = 800
End With

 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      7th May 2008
See the two <<< notations below...
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"test_52" <(E-Mail Removed)>
wrote in message
I have done some research and thought that I had this figured out, but it is
not giving me the result that I am looking for. I am trying to add a divider
to a drop down list between different macros. I thought this was done by the
BeginGroup property, but it is not adding the divider. I have posted a
section of my code below. Can anyone tell me if I am going about this wrong?
Any help would be great. Thanks, Jason

Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup,
temporary:=True)
With cmdBarMenu
.Caption = "Tools"
.Tag = "JJT"
End With
Set cmdBarMenuItem = cmdBarMenu.Controls.Add(Type:=msoControlButton)
With cmdBarMenuItem
.Caption = "Merge"
.OnAction = "MergeCells"
.Tag = "JJT"
.FaceId = 798
End With

'cmdBarMenu.BeginGroup = True '<<<< Not this

Set cmdBarMenuItem = cmdBarMenu.Controls.Add
With cmdBarMenuItem
.Caption = "Unmerge"
.OnAction = "UnmergeCells"
.Tag = "JJT"
.FaceId = 800
.BeginGroup = True '<<<< Do this instead
End With

 
Reply With Quote
 
test_52
Guest
Posts: n/a
 
      8th May 2008
Thanks a bunch! Figures it was something easy!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a pivot table in Excel 2007 from a QUERY in Access 2007 Neurogenesis Microsoft Excel Discussion 6 12th May 2011 11:25 AM
Excel 2007 adding error Erik Thorsteinsson Microsoft Excel Crashes 7 22nd Mar 2009 11:36 PM
Adding a column in Excel 2007 nip Microsoft Excel Discussion 3 10th Dec 2008 07:59 PM
Adding separater/divider bars between groups =?Utf-8?B?bGlsc2Fzc3k=?= Microsoft Outlook Installation 1 1st Oct 2006 07:45 PM
Word destrots the comma as decimal divider in Excel =?Utf-8?B?VHZlcm1vZXM=?= Microsoft Excel Misc 1 26th Aug 2005 03:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:55 AM.