Solved

Copy all from webbrowser

Posted on 2011-02-17
4
260 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

705 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

15 Experts available now in Live!

Get 1:1 Help Now