您的位置:首页 > 其它

获取当前的Excel版本内置的工具栏的名称和类型

2016-12-07 10:43 363 查看
   
获取当前的Excel版本内置的工具栏的名称和类型

    Dim oCmdBar As CommandBar

    Dim i, temp

    [a1:c1] = Array("在集合中引用的名称", "当前系统的菜单名称", "类型")

    i = 2

    For Each oCmdBar In Application.CommandBars

        Select Case oCmdBar.Type

            Case 0

                temp = "msoBarTypeNormal"

            Case 1

                temp = "msoBarTypeMenuBar"

            Case 2

                temp = "msoBarTypePopup"

        End Select

        Cells(i, 1) = oCmdBar.Name

        Cells(i, 2) = oCmdBar.NameLocal

        Cells(i, 3) = temp

        i = i + 1

    Next
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: