[بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله وبركاته
لقد ظهرت لي رسالة الخطأ التالية عندما فتحت البرنامج
الرجاء المساعدة و لكم جزيل الشكر
زينة الطائي
Sub hide()
Sheets("data").Cells(16, 1) = 0
Dim cb As CommandBar
Dim comd() As String
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
For Each cb In .CommandBars
If cb.Visible = True Then
Sheets("data").Cells(16, 1) = Sheets("data").Cells(16, 1) + 1
End If
Next
End With
'''''''''''''''''''''''''''''''''''
tt = Sheets("data").Cells(16, 1)
With Application
gg = 16
For Each cb In .CommandBars
If cb.Visible = True Then
Sheets("data").Cells(gg, 4) = cb.Name
gg = gg + 1
End If
Next
End With
'''''''''''''''''''''''''''''''''''
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
For Each cb In .CommandBars
If cb.Visible = True Then
ReDim Preserve comd(Sheets("data").Cells(16, 1))
comd(UBound(comd)) = cb.Name
If cb.Name = "Worksheet Menu Bar" Then
cb.Enabled = False
Else
cb.Visible = False
End If
End If
Next cb
End With
End Sub