Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Sendkeys to external application not working

I am trying to use vba to launch a file (external application) and
when it has launched press F9. My code below launches the file and it
is visible but it doesn't hit F9. When I look at my taskbar it is the
spreadsheet that looks like it is active rather than the external app.

Code:

Sub OpenDashboard()

Dim dReturnValue As Double
dReturnValue = Shell("C:\Program Files\PRISM Europe\Dashboard
\dashboard.exe G:\isosbsm\BST Service\Proactive Service Management
\Wincharts\LPAS Dashboard.dsh")
AppActivate dReturnValue
SendKeys "{F9}", True


End Sub




Does anyone have any ideas?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sendkeys to external application not working

On Jul 12, 9:25*am, Shazbot79
wrote:
I am trying to use vba to launch a file (external application) and
when it has launched press F9. My code below launches the file and it
is visible but it doesn't hit F9. When *I look at my taskbar it is the
spreadsheet that looks like it is active rather than the external app.

Code:

Sub OpenDashboard()

* * Dim dReturnValue As Double
* * dReturnValue = Shell("C:\Program Files\PRISM Europe\Dashboard
\dashboard.exe G:\isosbsm\BST Service\Proactive Service Management
\Wincharts\LPAS Dashboard.dsh")
* * * * AppActivate dReturnValue
* * * * SendKeys "{F9}", True

End Sub

Does anyone have any ideas?
Thanks


I use Sendkeys to automate another program that processes tickets from
inside excel.

The steps I use is:

1. shell out application
2. Activate Workbook "thisworkbook.activate"
3. Activate Application -- the code I use is Appactivate "TRIPS" <--
"TRIPS" being what the Caption is for the Window. You dont have to
use the entire Caption, just the first part of which is unique to all
other windows.
4. I normally have the application wait a few seconds so that Excel
can flip over to the application: Application.Wait Now +
TimeValue("00:00:02")
5. Then you can use Sendkeys;
SendKeys cell.Offset(0, 3).Value
SendKeys "{TAB 2}", True

Or in your case SendKeys "{F9}", true

Let me know if this helps you out. I think your next direction would
be to simply your code. Shell out your app and see what the caption
is for the window. After you succesfully shell it out, then you can
work on sending keys. Remember that you must isolate Excel and your
App and then flip between the 2 (depending if your needing a response
to import back into excel or not).

Great Luck!

Dave
Reply
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
Application.SendKeys & Printing vba_dan Excel Programming 3 March 23rd 10 09:35 AM
Close an application with sendkeys ina Excel Programming 2 May 16th 06 08:15 AM
The application SendKeys Jim333[_6_] Excel Programming 2 August 17th 05 05:44 AM
SendKeys and Application.ScreenUpdating Michael Malinsky[_2_] Excel Programming 3 March 23rd 05 10:40 PM
Application.sendkeys Adrie Rahanra Excel Programming 1 October 15th 03 04:29 PM


All times are GMT +1. The time now is 06:51 PM.

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"