VSTO: Application Focus
Anyone know of a way to see if the Excel window of a VSTO project is active/in focus? I'm looking for an equivalent of System.Windows.Window.IsActive . I've been frustrated with this as well. Are you using a dialog in the VSTO app? If so, what I have done is add an event to the closing of a Windows Form/Dialog to activate the Office application as follows (example is with Word, so there may be differences in Excel): //... VSTO Startup Event WindowsForm form = new WindowsForm(); form.FormClosed += new FormClosedEventHandler(form_FormClosed); form.Show(); void form_FormClosed(object sender,