I was on google searching for a way to insert the 2003 color palette into 2007 when I came across a thread from 2009 where someone showed how to add a tab on the ribbon using VBA that adds the 2003 color palette. I've shown the code below, included the attachment he posted and provided the link to the original thread.
The problem I have is although the attachment he sent shows the new tab on the ribbon perfectly, it doesn't work on my workbook. I added a module, pasted his code into my new module, saved my workbook, and upon reloading the workbook the new tab on the ribbon does not appear. Does anyone know how to get this tab to appear on a new workbook?
Thanks.
Link to prior thread:
http://www.excelforum.com/excel-2007...el-2003-a.html
Sub m_ApplyFillColor(CIndex As Long)
On Error GoTo ErrApplyColorIndex
If TypeOf Selection Is Range Then
Selection.Interior.ColorIndex = CIndex
ElseIf TypeOf Selection Is Object Then
Selection.ShapeRange.Fill.ForeColor.SchemeColor = CIndex + 7
End If
ErrApplyColorIndex:
Exit Sub
End Sub
Public Sub rbxColorIndex_Click(control As IRibbonControl, selectedId As String, selectedIndex As Integer)
'
' Code for onAction callback. Ribbon control gallery
'
Dim vntColorIndex As Variant
vntColorIndex = Application.WorksheetFunction.VLookup(selectedIndex, ThisWorkbook.Names("OLD_PALETTE").RefersToRange, 2, False)
If IsError(vntColorIndex) Then Exit Sub
m_ApplyFillColor CLng(vntColorIndex)
End Sub
Bookmarks