Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

1 Kasım 2011 Salı

Add Classic Excel Menu

'Module1

'Available References List
'1) Name: VBA, Description: Visual Basic For Applications
'2) Name: Excel, Description: Microsoft Excel 14.0 Object Library
'3) Name: stdole, Description: OLE Automation
'4) Name: Office, Description: Microsoft Office 14.0 Object Library



Sub Add_Excel2003_Menus_ToolBars()
    On Error Resume Next
    Dim i As Integer
    Dim CB As CommandBar
    Dim CBC As CommandBarControl
    Const Menu2003 As String = "Excel 2003 Menu"
    Const ToolBar2003 As String = "Excel 2003 Toolbar"
    With Application
        .CommandBars(Menu2003).Delete
        .CommandBars(ToolBar2003).Delete
        Set CB = CommandBars.Add(Menu2003, , , True)
    End With
    With CB
        .Visible = True
        For i = 1 To 10
            Set CBC = .Controls.Add(Type:=msoControlPopup, ID:=30001 + i)
        Next i
        Set CBC = .Controls.Add(Type:=msoControlPopup, ID:=30022) 'Chart
        Set CBC = .Controls.Add(Type:=msoControlPopup, ID:=30177) 'AutoShapes
    End With
    Set CB = CommandBars.Add(ToolBar2003, , , True)
    With CB
        .Visible = True
        With .Controls
            Set CBC = .Add(Type:=msoControlButton, ID:=2520) 'New
            Set CBC = .Add(Type:=msoControlButton, ID:=23) 'Open
            Set CBC = .Add(Type:=msoControlButton, ID:=3) 'Save
            Set CBC = .Add(Type:=msoControlButton, ID:=4) 'Print
            Set CBC = .Add(Type:=msoControlButton, ID:=109) 'Print Preview
            Set CBC = .Add(Type:=msoControlButton, ID:=2) 'Spelling
            Set CBC = .Add(Type:=msoControlButton, ID:=21) 'Cut
            Set CBC = .Add(Type:=msoControlButton, ID:=19) 'Copy
            Set CBC = .Add(Type:=msoControlButton, ID:=22) 'Paste
            Set CBC = .Add(Type:=msoControlButton, ID:=108) 'Format Painter
            Set CBC = .Add(Type:=msoControlButton, ID:=210) 'Sort Ascending
            Set CBC = .Add(Type:=msoControlButton, ID:=211) 'Sort Descending
            Set CBC = .Add(Type:=msoControlButton, ID:=984) 'Help
            Set CBC = .Add(Type:=msoControlComboBox, ID:=1728) 'Font
            Set CBC = .Add(Type:=msoControlComboBox, ID:=1731) 'Font Size
            Set CBC = .Add(Type:=msoControlButton, ID:=113) 'Bold
            Set CBC = .Add(Type:=msoControlButton, ID:=114) 'Italic
            Set CBC = .Add(Type:=msoControlButton, ID:=115) 'Underline
            Set CBC = .Add(Type:=msoControlButton, ID:=120) 'Align Left
            Set CBC = .Add(Type:=msoControlButton, ID:=122) 'Center
            Set CBC = .Add(Type:=msoControlButton, ID:=121) 'Align Right
            Set CBC = .Add(Type:=msoControlButton, ID:=402) 'Merge and Center
            Set CBC = .Add(Type:=msoControlButton, ID:=395) 'Accounting Number Format
            Set CBC = .Add(Type:=msoControlButton, ID:=396) 'Percent Style
            Set CBC = .Add(Type:=msoControlButton, ID:=397) 'Comma Style
            Set CBC = .Add(Type:=msoControlButton, ID:=398) 'Increase Decimal
            Set CBC = .Add(Type:=msoControlButton, ID:=399) 'Decrease Decimal
            Set CBC = .Add(Type:=msoControlButton, ID:=3162) 'Decrease Indent
            Set CBC = .Add(Type:=msoControlButton, ID:=3161) 'Increase Indent
        End With
    End With
    Set CB = Nothing
    Set CBC = Nothing
    On Error GoTo 0
End Sub



Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul