Solved

Copy all from webbrowser

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

932 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

10 Experts available now in Live!

Get 1:1 Help Now