Hi I have this in my module and I must of done something earlier that I don't know of and when I open an excel sheet I get a break.
Its breaks at .Caption = strCap
and I don't know why also it says commandBarbutton failed
Does anyone know why this is happening thanks
Its breaks at .Caption = strCap
and I don't know why also it says commandBarbutton failed
Does anyone know why this is happening thanks
Code:
Function CreateControl(container As Variant, strCap As String, strTip As String, lngType As MsoControlType, Optional tagLine, Optional Macro) As CommandBarControl
Dim ctrl
Set ctrl = container.Controls.Add(lngType)
With ctrl
.Caption = strCap <--------- Breaks
.TooltipText = strTip
If Not IsMissing(tagLine) Then .Tag = tagLine
If Not IsMissing(Macro) Then .OnAction = Macro
End With
Set CreateControl = ctrl
End Function