title: Copy from Excel to Browser
body: <p>How do I "paste" in Selenium/VBA to browser textfield?</p>
  
  <p>I downloaded and installed this: <a href="https://code.google.com/p/selenium-vba/" rel="nofollow">https://code.google.com/p/selenium-vba/</a></p>
  
  <p>I managed to start Selenium in Firefox (CTRL-ALT-S) and recorded my steps for automation. I changed the code language to VBA in there and copied it to paste it in Excel.</p>
  
  <p>For those of you who want to know what to do in Excel (2013):</p>
  
  <blockquote>
    <p>Right click "Start" 
    Customize Ribbon
    Check "Developer Tools" on the right 
    Click OK > Click on "Developer Tools" > Click "Visual Basic" > Click "Extras" > Click "References" > Look for "SeleniumWrapper Type Library" and check it > Click OK > In Menu bar click on the top arrow beside "Paste UserForm" > Click "Module" > Now paste the VBA Code from Selenium (Firefox) Plugin in there</p>
  </blockquote>
  
  <p>Everything works perfectly fine but I want it to do repetitive web browser tasks so it should copy Excel cells and paste it in Textboxes in Websites for example in the Google Searchbar.</p>
  
  <p>I already found a solution for the copying part: <br>
  <code>Range("A1").Copy</code></p>
  
  <p>It works but I can't find any working solution for the pasting part. Tested but didn't work:</p>
  
  <p><code>driver.findElementById("ID").SendKeys "^v"</code> gives out "v" instead of pasting.</p>
  
  <p><code>driver.findElementById("ID").SendKeys(Keys.chord(Keys.CONTROL, "v"));</code> Doesn't accept ";" and also doesn't work without.</p>
  
  <p>I also tried several "Wait" and "Sleep" codes but neither do I know for sure which of them actually work nor if they are necessary.</p>
  
  <p><code>driver.action.key_down(: control)</code> Didn't work.</p>
  
  <p><code>driver.findElementById("ID").keyDown(Keys.CONTROL).sendKeys(String.valueOf('\u0076')).perform();</code> Syntax error, without ";" "Error: List Delimiter" and marks the "." between "String" and "value".</p>
  
  <p>I am grateful for any advice!</p>