static void JumpToTarget() { Xl.Range r = Instance.Default.Application.Selection as Xl.Range; string value = (r == null) ? String.Empty : Convert.ToString(r.Formula); Jumper j = new Jumper(value); if (!j.Jump()) { NotificationAction a = new NotificationAction( Strings.JumpToTarget, Strings.UnableToJump, Strings.Close); a.Invoke(); } }
public static Jumper FromSelection() { Jumper jumper = null; var selection = Instance.Default.Application.Selection; Range r = selection as Range; if (r != null) { string s = String.Format(r.Value2); Logger.Info("FromSelection: {0}", s); jumper = new Jumper(s); } else { Logger.Info("FromSelection: Cannot create instance, selection is a {0}", selection.GetType().FullName); } Bovender.ComHelpers.ReleaseComObject(selection); return(jumper); }