Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AppActivate trouble...

I was using AppActivate with the Sendkeys statement with
great success on my old workstation (P2-366Mhz with NT) in
a workbook I use all day to communicate with a program
running in the background. Today I got a new workstation
(P4-2Ghz with XP), loaded the workbook and the macro
doesn't work as well. The first time I try after loading
up the workbook it works and then the second time it
doesn't activate the background app (I don't know if it's
trying to send the keys). And it'll work intermittently
after that... Any help would greatly appreciated.

btw... i do have the wait option set to true...

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default AppActivate trouble...

David Kay wrote:
I was using AppActivate with the Sendkeys statement with
great success on my old workstation (P2-366Mhz with NT) in
a workbook I use all day to communicate with a program
running in the background. Today I got a new workstation
(P4-2Ghz with XP), loaded the workbook and the macro
doesn't work as well.


Maybe a timing problem of some sort.

You may need to insert a DoEvents before the SendKeys to give the
AppActivate a chance to work - otherwise the keys may be being
swallowed by something else.

You may even need to insert a delay.

Here's a procedure to sleep for a while:

' at the top of your module
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

' in your code
Sleep 500 ' wait half a second

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

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
IRR Trouble jeff Excel Worksheet Functions 1 August 20th 07 09:42 PM
more trouble with i Ralphael1 New Users to Excel 9 July 24th 05 02:55 AM
still having trouble with this.... nick Excel Worksheet Functions 4 March 13th 05 07:40 PM
trouble with add ins caia Excel Discussion (Misc queries) 1 February 16th 05 01:17 AM
appactivate sendkeys not working with accelerator RB Smissaert Excel Programming 4 August 12th 03 08:31 PM


All times are GMT +1. The time now is 08:15 AM.

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

About Us

"It's about Microsoft Excel"