Excel refused Sendkeys why? 
Author Message
 Excel refused Sendkeys why?

I tried to use MS Excel97's Filter Option from WSH.
Then after opening the data sheet with application
control procedure, I sent some keystrokes as follows;

Set objXL = WScript.CreateObject ("Excel.Application")
Set objSheet = objXl.WorkBooks.Open("SomeData.xls")

  objXL.Sendkeys "%D"
  objXL.Sendkeys "{DOWN}{RIGHT}A"
' Filter Option Setting
  objXL.Sendkeys "%O"  <-Excel returns Err

 objXL.Sendkeys "%L"  <-Excel returns Err
 objXL.Sendkeys "sheet1!$A$2:$X$41"  <-Excel returns Err

 objXL.Sendkeys "%C"  <-Excel returns Err
 objXL.Sendkeys "sheet2!$F$1:$F$2"  <-Excel returns Err

 objXL.Sendkeys "%T"  <-Excel returns Err
 objXL.Sendkeys "sheet2!$G$1:$L$2"  <-Excel returns Err
' Execute
 objXL.Sendkeys "{ENTER}"  <-Excel returns Err

However all the lines from the third caused the Err massage
saying "the keystroke was refused by Excel". I simply wonder
why. Does anybody know the reason?
--

-----------------------------
  (Osamu Terao)

-----------------------------



Thu, 27 Dec 2001 03:00:00 GMT  
 Excel refused Sendkeys why?
Did you test whether your cell input was terminated with a Enter key?
If you send something to a cell whithout ending the input with Enter,
EXCEL is blocked! You can't use any other Excel method (I came
across this problem during writing my WSH Tutorial). Maybe this tip
helps.

G. Born

Check out my WSH Bazaar at:
http://ourworld.compuserve.com/homepages/Guenter_Born/index0.htm


Quote:
>I tried to use MS Excel97's Filter Option from WSH.
>Then after opening the data sheet with application
>control procedure, I sent some keystrokes as follows;

>Set objXL = WScript.CreateObject ("Excel.Application")
>Set objSheet = objXl.WorkBooks.Open("SomeData.xls")

>  objXL.Sendkeys "%D"
>  objXL.Sendkeys "{DOWN}{RIGHT}A"
>' Filter Option Setting
>  objXL.Sendkeys "%O"  <-Excel returns Err

> objXL.Sendkeys "%L"  <-Excel returns Err
> objXL.Sendkeys "sheet1!$A$2:$X$41"  <-Excel returns Err

> objXL.Sendkeys "%C"  <-Excel returns Err
> objXL.Sendkeys "sheet2!$F$1:$F$2"  <-Excel returns Err

> objXL.Sendkeys "%T"  <-Excel returns Err
> objXL.Sendkeys "sheet2!$G$1:$L$2"  <-Excel returns Err
>' Execute
> objXL.Sendkeys "{ENTER}"  <-Excel returns Err

>However all the lines from the third caused the Err massage
>saying "the keystroke was refused by Excel". I simply wonder
>why. Does anybody know the reason?
>--

>-----------------------------
>  (Osamu Terao)

>-----------------------------



Fri, 28 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SendKeys in Excel 97

2. Why why why why?

3. Why can't I launch Excel?

4. WHY, WHY, WHY!!!!!

5. page counter refuses to work

6. gcc on ultrix4.2 refuses to build gs3.53

7. CreateObject refuses to create remote Object

8. Cloned tbody object refuses to fire onclick event (addendum to previous post)

9. Wscript.shell refusing to run a command from an ASP page

10. permission refused

11. When object refuse to die

12. WScript refuses to sleep(WTF!?)

 

 
Powered by phpBB® Forum Software