I have a .xlsx file that I wish to launch in Excel from C#. To do this I use the Process.start() API with the open verb.
This works fine except that the Excel window appears briefly and then gets hidden behind the main app.
Oddly launching a PDF (Adoboe Viewer as the default view) using exactly the same API in exactly the same section of code works fine, the PDF appears maximised and stays there. This would appear to rule out my app moving itself back to the front after Excel has launched.
Does anyone know what might be causing this?
EDIT: added code
ProcessStartInfo startInfo = new ProcessStartInfo(filename);
startInfo.WindowStyle = windowStyle; // maximized
startInfo.Verb = "open";
startInfo.ErrorDialog = false;
Process.Start(startInfo);
Answering my own question.
Turns out this was a DevExpress bug/feature. It is something with their AlertControl that takes focus back when you click it.
DevExpress in the usual impressively prompt fashion have fixed the problem already. See this item