Hi Carlos,
First off, you could use something like:
Dim CTL As CommandBarControl, ModMac As String
For Each CTL In Application.CommandBars("Carlos").Controls
ModMac = Mid$(CTL.OnAction, InStr(1, CTL.OnAction, "!", 1) + 1)
CTL.OnAction = "'" & ThisWorkbook.Name & "'" & ModMac
Next CTL
But I think you'd have better luck if you created the commandbar when the workbook is loaded, and removed it when closed. That way you're sure that it is always correct. You could use something like:
Private Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Carlos").Delete
On Error GoTo 0
Application.CommandBars.Add "Carlos"
With Application.CommandBars("Carlos").Controls.Add
.Caption = "Macro 1"
.Tag = "Macro 1"
.OnAction = "'" & ThisWorkbook.Name & "'!ModuleName.MacroName"
End With
End Sub
Private Sub Workbook_BeforeClose()
On Error Resume Next
Application.CommandBars("Carlos").Delete
End Sub
in the ThisWorkbook module.
Just a thought
Matt