How to connect a ribbon button to a function defined in an Excel add-in?

删除回忆录丶 提交于 2019-12-06 06:52:55

This is a simple method for doing this:

    private void butRefreshSelectedWorksheets_Click(object sender, RibbonControlEventArgs e)
    {
        try
        {
            Globals.ThisAddIn.RefreshWorksheetListings();
        }
        catch (Exception ex)
        {
            System.Windows.Forms.MessageBox.Show("Error [butRefreshSelectedWorksheets_Click]: " + ex);
        }
    }

Use the Globals.ThisAddIn.... syntax to access app functions from within the ribbon.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!