That ended up working after changing "first" and "last" to all lowercase. Checking for multiple dots in the cmdbar name prevents quite a few exceptions, which are slow. This code still results in a few exceptions but it's not a big deal.
For i As Integer = (.Inst.Str2ID("cmdbar.first", False) + 1) To (.Inst.Str2ID("cmdbar.last", False) - 1)
If .Inst.ID2Str(i).Split(".").Length < 3 Then .Inst.ShowCmdBar2(i, False)
Catch ex As Exception