Ask a questionAsk a question
 

QuestionSendKeys, can't use Find

  • Tuesday, November 03, 2009 3:34 PMjimjofpn Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    (Newbie to SendKeys)

    I want to enter values from Excel into a webpage with over 200 text boxes.  I can {TAB} through the boxes, as long as they are in the expected order, which they seem to be.  Initial tests work fine. 

    But it would be more elegant and less chance for error if I searched for the label for each box.  So I sent "^fLabelText", but "LabelText" does not get entered into the Find box.  The Find box opens, but no search text.  So, I thought maybe I have to AppActivate the Find box, but that crashes the macro with "Invalid Procedure Call or Argument".

    Don't know where to turn, any ideas?

    (edit) Just realized, the LabelText got entered into IE's URL box!  So obviously, the Find box doesn't have the focus.

All Replies

  • Tuesday, November 03, 2009 4:26 PMNavin Narayan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    have you tried having a delay after "^f" ?

    Also can you use a FindWindow call to get the handle of the search window?
    Regards, Navin Narayan
  • Tuesday, November 03, 2009 4:56 PMjimjofpn Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks, that's a step in the right direction! 

    A one second delay does indeed get the search test into the find box.  But now I'm trying to find keystrokes to close the thing!  I tried {ESC} and %{F4} to no avail.  Also, I'm concerned that a one second delay (the minimum) will make the process excruciatingly slow.  I'll check out FindWindow, which I've never used before.

  • Tuesday, November 03, 2009 4:58 PMjimjofpn Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hmmm, can't find FindWindow...