Solved

Sendkeys problem

Posted on 2011-03-19
6
390 Views
Last Modified: 2013-12-04
I'm trying to automate a repetitive task and having trouble.  I'm using "Sendkeys", but I think Javascript might be getting in my way.

When I tab to the size area (see attached picture) and send a down arrow key, it assumes 4x6 and runs some code when I need to choose 8x12. Size Options
0
Comment
Question by:hrolsons
6 Comments
 
LVL 32

Expert Comment

by:Robberbaron (robr)
Comment Utility
have you tried using the elements of the webbrowser control ratehr than sendkeys.  SendKeys is quite unreliable as it relies upon an application not losing focus or repainting.

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_25082070.html

http://vbcity.com/blogs/jatkinson/archive/2009/12/12/programmatically-entering-and-data-using-the-webbrowser-control.aspx
0
 

Author Comment

by:hrolsons
Comment Utility
I see what you're saying robberbaron.  I'm looking for the equivalent of your links for Visual Basic 6.
0
 
LVL 12

Expert Comment

by:satsumo
Comment Utility
Could you get a handle to the dropdown list and send it a CB_SETCURSEL message?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:hrolsons
Comment Utility
Not quite sure what you mean, the code behind the dropdown is:

            <div class="addsizes">
            Choose from more print sizes:</span>

            <select name="lstSizes" onchange="javascript:setTimeout('__doPostBack(\'lstSizes\',\'\')', 0)" id="lstSizes" class="dropdown">
      <option selected="selected" value="0">--add size--</option>
      <option value="3">4x6</option>
      <option value="2">3.25x5</option>
      <option value="262">4x4</option>
      <option value="7">4x5.3</option>

      <option value="263">5x5</option>
      <option value="8">5x6.5</option>
      <option value="4">5x7</option>
      <option value="264">6x6</option>
      <option value="9">6x8</option>
      <option value="265">8x8</option>

      <option value="5">8x10</option>
      <option value="10">8x10.6</option>
      <option value="211">8x12</option>
      <option value="266">10x10</option>
      <option value="6">10x13</option>
      <option value="72">10x15</option>

      <option value="1">Wallets(4)</option>

</select>
            </div>
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
Comment Utility
try sending four "8" characters.
0
 

Author Comment

by:hrolsons
Comment Utility
Brilliant!!!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now