public void DiscardChangesButton_Click(IRibbonControl control) { if (activeWorkbookBranch == null) { return; } var workbookPath = xlApp.ActiveWorkbook.FullName; //get `other branch` var branch = activeWorkbookBranch.OtherBranch; //delete branch and close working copy activeWorkbookBranch.Discard(); xlApp.ActiveWorkbook.Close(false); //delete working copy File.Delete(workbookPath); //re-checkout and re-open var stagingBranch = branch.Checkout(); workbookPath = OpenWorkbook(stagingBranch); xlApp.Workbooks.Open(workbookPath); ribbon.ActivateTab("xltrail"); }
public void OnLoad(IRibbonUI ribbon) { R = ribbon; R.ActivateTab(ControlID: "Tab1"); }