LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is Controlling External Apps with Excel VBA possible?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help - Alt-E hotkey does not work in MSOffice apps, no prob in other apps Bob Newheart Excel Discussion (Misc queries) 4 July 28th 08 03:57 PM
After OpenText all pastes from external apps use format from OpenText Jim[_31_] Excel Programming 1 November 8th 03 02:17 AM
Running apps from inside excel David Excel Programming 1 September 8th 03 12:30 PM
Handling Excel Apps? andy. Excel Programming 1 July 25th 03 04:51 AM
Switching to other apps while running macros in excel 97 Jon Peltier[_3_] Excel Programming 2 July 11th 03 10:49 PM


All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"