private void AddToolBar()
        {
            Office.CommandBars bars = AppExcel.CommandBars;            if (bars == null)
                return;            foreach (Office.CommandBar bar in bars)
            {
                if (bar.Name.ToLower().Trim() == "dacs")
                {
                    bar.Delete();
                }
            }            Office.CommandBar dacsBar = AppExcel.CommandBars.Add("DACS", 1, null, null);
            if (dacsBar != null)
            {
                btnTest = (Office.CommandBarButton)dacsBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true);
                if (btnTest != null)
                {
                    btnTest.Caption = "Test";
                    btnTest.Style = Office.MsoButtonStyle.msoButtonIconAndCaptionBelow;
                    btnTest.TooltipText = "Test";
                    btnTest.FaceId = 3277;
                    btnTest.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(btnTest_Click);
                }
                btnAddPic = (Office.CommandBarButton)dacsBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true);
                if (btnAddPic != null)
                {
                    btnAddPic.Caption = "插入图片";
                    btnAddPic.Style = Office.MsoButtonStyle.msoButtonIconAndCaptionBelow;
                    btnAddPic.TooltipText = "插入图片";
                    Image img = Image.FromFile("folder.ico");
                    btnAddPic.Picture = (stdole.IPictureDisp)img;
                    btnAddPic.FaceId = 3277;
                    btnAddPic.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(btnAddPic_Click);
                }                btnMergeCells = (Office.CommandBarButton)dacsBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true);
                if (btnMergeCells != null)
                {
                    btnMergeCells.Caption = "合并单元格";
                    btnMergeCells.Style = Office.MsoButtonStyle.msoButtonIconAndCaptionBelow;
                    btnMergeCells.TooltipText = "合并单元格";
                    btnMergeCells.FaceId = 3277;
                    btnMergeCells.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(btnMergeCells_Click);
                }                dacsBar.Visible = true;
            }
        }        void btnTest_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
        {
            //你要做的事情~~~~
            MessageBox.Show("Test");        }