11/23/2010 10:40 PM | |
Posts: 45 Rating: (4) |
I don't know what is your application, and if you are going to upgrade your code for more functions using VB script with excel, because I can't find such function "show in foreground" with VB. Anyway here is a small C-script to open excel sheet and put it in foreground if it is already opened: [code]#include "apdefap.h" void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName) { HWND Handle= NULL; Handle= FindWindow("XLMAIN",NULL); //applecation name if(Handle) { ShowWindow(Handle, SW_MINIMIZE); ShowWindow ( Handle, SW_SHOWNORMAL ); SetForegroundWindow(Handle); } else ProgramExecute("C:\\Program Files\\Microsoft Office\\Office12\\Excel.exe D:\\Excel_file.xls"); }[/code] Just be care that your file name is without spaces. fore more info please refer to this FAQ: How do you bring the window of another program into the foreground in WinCC? Hope I helped. Best Regards, |
11/24/2010 2:42 PM | |
Joined: 11/22/2010 Last visit: 2/14/2022 Posts: 22 Rating: (0) |
Hi, I don't have a knowledge (experience) in C-Script, if you can give me a code in VB-Script |
12/2/2010 9:41 AM | |
Joined: 11/22/2010 Last visit: 2/14/2022 Posts: 22 Rating: (0) |
Hello, Doesn't someone have a solution for me? Thank you |
7/29/2011 8:56 AM | |
Joined: 11/22/2010 Last visit: 2/14/2022 Posts: 22 Rating: (0) |
I need your assistance. Please Bigasse |
7/29/2011 1:53 PM | |
Joined: 9/8/2005 Last visit: 3/7/2024 Posts: 177 Rating: (15) |
Hello, sorry that I must told you there is no other way to determine a window handle as ' HMZ' said his last message - it is only possible to do this in C scripting language,
|
Follow us on