Hi,
The use of ID-numbers for controls override heavy problem when working with different language-versions
The method FindControls is depended on ID-numbers.
Following code shows how to list ID-numbers.
(It´s swedish inspired but hopefully You see what You can do.)
<pre>
Sub Lista_Alla_Verktygsfält_Kontrollers_NamnIDnr()
Dim cbVFalt As CommandBar
Dim cbKontroll As CommandBarControl
Dim RnCell As Range
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
On Error Resume Next
With ActiveWorkbook
.Worksheets("Menynamn och ID-nummer").Delete
.Worksheets.Add
End With
ActiveSheet.Name = "Menynamn och ID-nummer"
Set RnCell = Range("A1")
For Each cbVFalt In Application.CommandBars
With RnCell
.Font.Bold = True
.Value = cbVFalt.NameLocal & " " & "ID-nr:" & cbVFalt.Index
End With
For Each cbKontroll In cbVFalt.Controls
Lista_Kontroller RnCell, cbKontroll
Next cbKontroll
Next cbVFalt
Columns("A:B").EntireColumn.AutoFit
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub
Sub Lista_Kontroller(rnMal As Range, cbKontroll As CommandBarControl)
Dim cbKontroller As CommandBarControl
On Error GoTo Felhantering:
Set rnMal = rnMal(2, 1)
rnMal.Value = cbKontroll.Caption
rnMal(1, 2).Value = cbKontroll.ID
For Each cbKontroller In cbKontroll.Controls
Lista_Kontroller rnMal, cbKontroller
Next cbKontroller
Felhantering:
End Sub
</pre>
Kins regards,
Dennis