Вот код:
With Application.CommandBars("Status Bar") If .Visible = False Then .Visible = True Else .Visible = False End IfEnd With
Спасибо.
Sub Макрос1() With Application.CommandBars("Status Bar") If .Visible = False Then .Visible = True Else .Visible = False End If End WithEnd Sub
Вы просто в одной строке написали If .Visible = False Then .Visible = True - а это означает для компилятора, что Else у вас в этом if уже не будет. Т.е. после слова Then надо переводить каретку вниз.