Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I've searched through the previous posts, and I don't think what I want to do is possible with VBA in Excel 2002 (SP-2) but I'll pose the question just in case. I'm using a Shell command in an Excel VBA macro to run an external app, but it isn't quite working as I had anticipated. Im using the following syntax: MyAppID = Shell("App_Path&Name.EXE", vbHide) Which works and the program loads OK, but the problem is no matter what windowstyle argument I use: vbHide, vbMinimizedFocus, vbMinimizedNoFocus or even omitting an argument (which is meant to according to the help file :"-If windowstyle is omitted, the program is started minimized with focus.-") the application window opens in front of the Excel Window (which I want to retain focus). The Excel task on the start/task bar flashes, and must be clicked on to once again become the window that is in focus. The application being loaded acts as a conduit between a data provider and Excel and as such must remain open for the rest of the macro to complete successfully. As a consequence I've coded the macro to display a message box, that must be clicked before the macro continues, but you must click on the Excel task on the start/task bar in order to see this message box. I would prefer the application window to open in a minimised state, but it appears to open in the previously used state. I.e. If it was closed the previous time maximised then it opens maximised, or if it only took up the half the screen, it again opens to the same position (half the screen). The logical conclusion would be to close the program in a minimised state each time, but as others use the application for different purposes from the same PC, I can not assume that this will be the case. Closing the application window prior to the macro completing processing isn't an option either. A couple of things to note: I'm using Win XP pro, on a Dell corporate workstation, and the MyAppID is not declared as a variable of any type (though when I did declare it, I got the same result, so I don't think it is that). So is it possible to somehow use the MyAppID variable to control the opened app window to minimise the window from the VBA code in Excel? If not is there another way to minimise the app, without doing it manually? Why is the window state command I've used being ignored? Thanks in Advance. Az --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help - Alt-E hotkey does not work in MSOffice apps, no prob in other apps | Excel Discussion (Misc queries) | |||
After OpenText all pastes from external apps use format from OpenText | Excel Programming | |||
Running apps from inside excel | Excel Programming | |||
Handling Excel Apps? | Excel Programming | |||
Switching to other apps while running macros in excel 97 | Excel Programming |