troubleshooting Question

Send Key command in VBA

Avatar of Aleyna
Aleyna asked on
Microsoft OfficeVisual Basic ClassicMicrosoft Excel
3 Comments1 Solution15831 ViewsLast Modified:
I have a program which automates a webbrowser application within a userform. There were a couple of reasons why this was initialy done like that.

The problem is the program is running the user can not do anything else... For example if you click on something else the macro errors out as it can not function.

My question is: Is there a way to tell Excel to continue sending keys and working with that userform even if the user turns to something else?

Below is part of the code to give you an idea:

' Select the product number
    For j = 1 To 15
        SendKeys "{TAB}", True
    Next j
    SendKeys "{ENTER}", True
    ' wait until browser is free
    Do
        DoEvents
        If Connecting_IB.WebBrowser1.Busy Then 'If Browser is busy waits an extra 1 second
            Application.Wait TimeValue(Now) + TimeValue("00:00:01")
        Else
            Exit Do
        End If
    Loop
    ' Read External Reference
    externalref = Connecting_IB.WebBrowser1.Document.all("CsietInstance_TagNumber").Value
    Cells(i, 2) = externalref
Thanks,



Matt
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros