- ©«¤l
- 320
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- 2k
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-6-24
- ³Ì«áµn¿ý
- 2024-12-21
|
'¦Ûq¤u¨ã¦C
Dim Abar As CommandBar '«Å§i¤u¨ã¦Cª«¥ó
Dim ¤w´£¥Ü As Boolean
Private Sub Workbook_Open()
If ¤w´£¥Ü = False Then
¤w´£¥Ü = True
C = MsgBox("¥\¯à¿ï³æ¦b¤W¤è¤u¨ã¦Cªº¡u¼W¯q¶°¡v¸Ì!!!", vbExclamation, "¨Ï¥Î¤èªk")
End If
For Each Abar In Application.CommandBars
If Not Abar.BuiltIn Then Abar.Delete
Next
'«Å§i¤u¨ã¦C«ö¶sª«¥ó
Dim myButton1 As CommandBarButton '¿ï¾Ü¨Ï¥Î»¡©ú
Dim myButton2 As CommandBarButton '¿ï¾ÜºÞ¨îpµeªí
'·s¼W¤@Ó¤u¨ã¦C
Set Abar = Application.CommandBars.Add(Name:="µe±¿ï¾Ü")
With Abar
'µe±¿ï¾Ü----------------------------------------------
'¨Ï¥Î»¡©ú
Set myButton1 = .Controls.Add(msoControlButton)
With myButton1
.Style = msoButtonIconAndCaption '¦P®ÉÅã¥Ü¤å¦r©M¤p¹Ï¥Ü
.BeginGroup = True
.Caption = "¨Ï¥Î»¡©ú" 'Åã¥Ü¦b¤u¨ã¦C¤Wªº«ö¶s¤å¦r
'.TooltipText = "µe±¿ï¾Ü" '·Æ¹«²¾¹L¥h®É¡A©ÒÅã¥Üªº´£¥Ü¤å¦r
.FaceId = 487 '¤p¹Ï¥Ü
.Tag = "MyCustomTag"
.OnAction = "¿ï¾Ü¨Ï¥Î»¡©ú" '³]©w«ö¤U¦¹Áä®É©Òn°õ¦æªº¥¨¶°
End With
'ºÞ¨îpµeªí
Set myButton2 = .Controls.Add(msoControlButton)
With myButton2
.Style = msoButtonIconAndCaption '¦P®ÉÅã¥Ü¤å¦r©M¤p¹Ï¥Ü
.BeginGroup = True
.Caption = "ºÞ¨îpµeªí" 'Åã¥Ü¦b¤u¨ã¦C¤Wªº«ö¶s¤å¦r
'.TooltipText = "µe±¿ï¾Ü" '·Æ¹«²¾¹L¥h®É¡A©ÒÅã¥Üªº´£¥Ü¤å¦r
.FaceId = 69 '¤p¹Ï¥Ü
.Tag = "MyCustomTag"
.OnAction = "¿ï¾ÜºÞ¨îpµeªí" '³]©w«ö¤U¦¹Áä®É©Òn°õ¦æªº¥¨¶°
End With
.Position = msoBarTop '¤u¨ã¦CÂ\©ñ¦b¤W¼h
.Visible = True
End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Abar As CommandBar
For Each Abar In Application.CommandBars
If Not Abar.BuiltIn Then Abar.Delete
Next
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Workbook_Open
End Sub
|
|