-
February 10th, 2014, 02:57 PM
#1
excel automation - window doesn't come to the foreground in Windows Server 2008
We have a C++ 5.0 app that does something like this:
Creates the excel dispatch, exports the data, etc...
...
then calls these functions:
xlsApp.SetDisplayAlerts(TRUE);
xlsApp.SetVisible(TRUE);
xlsApp.SetUserControl(TRUE);
This has always worked to display the excel spreadsheet in the foreground, most recently on Windows Server 2003.
Now, testing on Windows Server 2008, the excel spreadsheet is created, but in the background.
Any suggestions on how to force it to the foreground?
Thanks much!
-
February 11th, 2014, 08:22 AM
#2
Re: excel automation - window doesn't come to the foreground in Windows Server 2008
I would immediately consider using a workaround, such as using FindWindow() and SetForegroundWindow().
Nobody cares how it works as long as it works
-
February 11th, 2014, 10:42 AM
#3
Re: excel automation - window doesn't come to the foreground in Windows Server 2008
Thank you so much for the tip! A very simple workaround, once I figured out to use "XLMAIN" for the application parameter in FindWindow().
HWND xlsHWnd = FindWindow(_T("XLMAIN"), NULL);
SetForegroundWindow(xlsHWnd);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|