Solved

Copy all from webbrowser

Posted on 2011-02-17
4
294 Views
Last Modified: 2012-06-27
For some reason, the following code isn't working.  It worked the first time I tried it and now isn't:

I'm basically trying to copy-paste all the info from a webbrowser.

Private Sub Command15_Click()
    WebBrowser1.SetFocus
    SendKeys ("^A^C")
    item_description.SetFocus
    SendKeys ("^V")
End Sub
0
Comment
Question by:hrolsons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Den_HBR
ID: 34923916
I have heard that some people have to use lowercase.
Try
Private Sub Command15_Click()
    WebBrowser1.SetFocus
    SendKeys ("^a^c")
    item_description.SetFocus
    SendKeys ("^v")
End Sub

Open in new window

0
 

Author Comment

by:hrolsons
ID: 34926495
Still not grabbing the contents of webbrowser.  It's strange, because if I change the code to:

Private Sub Command15_Click()
    WebBrowser1.SetFocus
End Sub

After I press Command15 I then manually pres:

ctrl-a
ctrl-s
click on item_description
click ctrl-v

It works perfect.
0
 
LVL 8

Accepted Solution

by:
Den_HBR earned 500 total points
ID: 34927025
Below works for me
 
WebBrowser1.SetFocus
SendKeys ("^a^c")
DoEvents
item_description.SetFocus
SendKeys ("^v")

Open in new window


(don't forget to try with capitals if lower case doesn't work for you)
0
 

Author Closing Comment

by:hrolsons
ID: 34927198
DoEvents did the trick.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

730 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