A
Azazel_123
Hi,
I've searched through the previous posts, and I don't think what I wan
to do is possible with VBA in Excel 2002 (SP-2) but I'll pose th
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 wha
windowstyle argument I use: vbHide, vbMinimizedFocus
vbMinimizedNoFocus or even omitting an argument (which is meant t
according to the help file :"-If windowstyle is omitted, the program i
started minimized with focus.-") the application window opens in fron
of the Excel Window (which I want to retain focus).
The Excel task on the start/task bar flashes, and must be clicked on t
once again become the window that is in focus. The application bein
loaded acts as a conduit between a data provider and Excel and as suc
must remain open for the rest of the macro to complete successfully. A
a consequence I've coded the macro to display a message box, that mus
be clicked before the macro continues, but you must click on the Exce
task on the start/task bar in order to see this message box. I woul
prefer the application window to open in a minimised state, but i
appears to open in the previously used state. I.e. If it was closed th
previous time maximised then it opens maximised, or if it only took u
the half the screen, it again opens to the same position (half th
screen).
The logical conclusion would be to close the program in a minimise
state each time, but as others use the application for differen
purposes from the same PC, I can not assume that this will be the case
Closing the application window prior to the macro completing processin
isn't an option either.
A couple of things to note: I'm using Win XP pro, on a Dell corporat
workstation, and the MyAppID is not declared as a variable of any typ
(though when I did declare it, I got the same result, so I don't thin
it is that).
So is it possible to somehow use the MyAppID variable to control th
opened app window to minimise the window from the VBA code in Excel? I
not is there another way to minimise the app, without doing i
manually? Why is the window state command I've used being ignored?
Thanks in Advance.
A
I've searched through the previous posts, and I don't think what I wan
to do is possible with VBA in Excel 2002 (SP-2) but I'll pose th
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 wha
windowstyle argument I use: vbHide, vbMinimizedFocus
vbMinimizedNoFocus or even omitting an argument (which is meant t
according to the help file :"-If windowstyle is omitted, the program i
started minimized with focus.-") the application window opens in fron
of the Excel Window (which I want to retain focus).
The Excel task on the start/task bar flashes, and must be clicked on t
once again become the window that is in focus. The application bein
loaded acts as a conduit between a data provider and Excel and as suc
must remain open for the rest of the macro to complete successfully. A
a consequence I've coded the macro to display a message box, that mus
be clicked before the macro continues, but you must click on the Exce
task on the start/task bar in order to see this message box. I woul
prefer the application window to open in a minimised state, but i
appears to open in the previously used state. I.e. If it was closed th
previous time maximised then it opens maximised, or if it only took u
the half the screen, it again opens to the same position (half th
screen).
The logical conclusion would be to close the program in a minimise
state each time, but as others use the application for differen
purposes from the same PC, I can not assume that this will be the case
Closing the application window prior to the macro completing processin
isn't an option either.
A couple of things to note: I'm using Win XP pro, on a Dell corporat
workstation, and the MyAppID is not declared as a variable of any typ
(though when I did declare it, I got the same result, so I don't thin
it is that).
So is it possible to somehow use the MyAppID variable to control th
opened app window to minimise the window from the VBA code in Excel? I
not is there another way to minimise the app, without doing i
manually? Why is the window state command I've used being ignored?
Thanks in Advance.
A