Thursday, April 11, 2013

GailsTools Bugfix

I have fixed a small bug that was causing the add-in to crash on load.

The old code was from some web tutorial and was trapping for errors rather than pre-testing for conditions.

Sub RemoveMenubar()
    On Error Resume Next
    Application.CommandBars(ToolBarName).Delete
    On Error GoTo 0
End Sub

The new code is below.

Sub RemoveMenubar()
    For Each cbar In CommandBars
        If cbar.Name = ToolBarName Then
            cbar.Delete
        End If
    Next
End Sub

GailsTools is now at v5.3.  

No comments:

Post a Comment