IE Automation - Stop clicking sound! How2Add Timer

Kreiz

New Member
Joined
May 6, 2011
Messages
38
Hello,

After summer of learning excel and VBA I feel like a pseudo guru with macros, TY much to all the boards!

I have a macro that logs into my work site and runs through thousands of rows of customer &/or carrier pages, only thing it is making the click sound when the online form is submitted. It would be fine if only once or twice now and then but this macro runs all the time and I am tired of hearing this CLICK sound when it runs.

I have tried .audible .sound .noise .stopannoyingfu64sound -ok the last wast on a humbug

this one goes to however many pages in column A but when it submits the form and clear or start over it clicks...this is annoying because it will go through many pages in a minute = LOTS OF CLICKING SOUND...and IE is not visible.

Code:
Dim ieDoc As Object
Dim ieEle As Object
Set ie = CreateObject("InternetExplorer.Application")
        ieDoc.all.UserName.Value = "haha"
        ieDoc.all.Password.Value = "hehe"
         ieDoc.forms(1).submit  'its the second form
        Do Until .ReadyState = 4: DoEvents: Loop
         Do While .Busy: DoEvents: Loop

    With ie
        .Visible = False
        '.audible = False
        .Navigate url
        Do Until .ReadyState = 4: DoEvents: Loop
        Set ieDoc = ie.Document
      k = 2      
       laneID = Range("a" & k)
       oZip = Range("e" & k)
       dZip = Range("h" & k)
       puDate = Range("p" & k)
      While laneID <> ""
      lastrow = ActiveSheet.UsedRange.Rows.Count
      Application.StatusBar = "    " & k - 1 & " of " & lastrow - 1 & "   " & oZip & "  -  " & dZip
      If k Mod 500 = 0 Then
            ThisWorkbook.Save
        End If
        On Error Resume Next
        
       If k Mod 500 = 0 Then
            ThisWorkbook.Save
        End If
       ieDoc.all.originZipCode.Value = oZip
        ieDoc.all.destinationZipCode.Value = dZip
        ieDoc.all.pickupdate.Value = puDate
          ieDoc.all.selectedTimeOfDay.Value = 4
          ieDoc.forms(2).submit
          Do Until .ReadyState = 4: DoEvents: Loop
          Do While .Busy: DoEvents: Loop
 'scrape
Set s = ie.Document.getelementsbytagname("TD").Item(73)
   txt = s.getAttribute("innertext")
       Worksheets("wkst").Range("m" & k).Value = txt
Set s = ie.Document.getelementsbytagname("TD").Item(74)
   txt = s.getAttribute("innertext")
       Worksheets("wkst").Range("n" & k).Value = txt
Set s = ie.Document.getelementsbytagname("TD").Item(75)
   txt = s.getAttribute("innertext")
       Worksheets("wkst").Range("o" & k).Value = txt
Set s = ie.Document.getelementsbytagname("TD").Item(76)
   txt = s.getAttribute("innertext")
       Worksheets("wkst").Range("q" & k).Value = txt
'Reset for Next load
Set ObjCollection = ie.Document.getelementsbytagname("input")
  I = 0
  While I < ObjCollection.Length
     If ObjCollection(I).Value = "Start Over" Then
           Set ObjElement = ObjCollection(I)
            Else
     If ObjCollection(I).Value = "Clear" Then
           Set ObjElement = ObjCollection(I)
            End If
            End If
     I = I + 1
     Wend
       ObjElement.Click
        Do Until .ReadyState = 4: DoEvents: Loop
          Do While .Busy: DoEvents: Loop
  
k = k + 1
 laneID = Range("a" & k)
 oZip = Range("e" & k)
 dZip = Range("h" & k)
Wend
Application.StatusBar = ""

         ie.Quit


Ooo would also like a timer to see how fast it has processed so many rows of data if you know of how.
:biggrin:
Any ideas are much appreciated, I have been scouring here and Google.
 
This will not work in the PM.... named wkst this is top few rows of thousands i need to run zips for. TY

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th><th>J</th><th>K</th><th>L</th><th>M</th><th>N</th><th>O</th><th>P</th><th>Q</th><th>R</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">laneID</td><td style=";">Volumn</td><td style=";">Source City</td><td style=";">Source State</td><td style="text-align: right;;"></td><td style=";">Destination City</td><td style=";">Destination State</td><td style=";">            </td><td style=";">Avg-Mile</td><td style=";">Avg-Rate</td><td style=";">OTR-RPM</td><td style=";">rail rpm</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">puDate</td><td style=";">Note</td><td style=";">Date/Time Taken</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style=";">CHICAGO</td><td style=";">IL</td><td style="text-align: right;;">60607</td><td style=";">STOCKTON</td><td style=";">CA</td><td style="text-align: right;;">95203</td><td style="text-align: right;;">627</td><td style="text-align: right;;">1399.576</td><td style="text-align: right;;">$2.23</td><td style="text-align: right;;">$2.11</td><td style=";">53' </td><td style=";">5 days </td><td style="text-align: right;;">$1,325.00 </td><td style="text-align: right;;">10/7/2011</td><td style=";">  </td><td style="text-align: right;;">1:24:51 AM</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style=";">BESSEMER</td><td style=";">AL</td><td style="text-align: right;;">35023</td><td style=";">ORLANDO</td><td style=";">FL</td><td style="text-align: right;;">32809</td><td style="text-align: right;;">627</td><td style="text-align: right;;">1399.576</td><td style="text-align: right;;">$2.23</td><td style="text-align: right;;">$2.29</td><td style=";">53' </td><td style=";">3 days </td><td style="text-align: right;;">$1,435.00 </td><td style="text-align: right;;">10/7/2011</td><td style=";">  </td><td style="text-align: right;;">1:24:54 AM</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td><td style=";">BESSEMER</td><td style=";">AL</td><td style="text-align: right;;">35023</td><td style=";">VERO BEACH</td><td style=";">FL</td><td style="text-align: right;;">32966</td><td style="text-align: right;;">696</td><td style="text-align: right;;">1588.86</td><td style="text-align: right;;">$2.28</td><td style="text-align: right;;">$2.36</td><td style=";">53' </td><td style=";">3 days </td><td style="text-align: right;;">$1,643.00 </td><td style="text-align: right;;">10/7/2011</td><td style=";">  </td><td style="text-align: right;;">1:24:56 AM</td></tr></tbody></table><p style="width:2.4em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">wkst</p><br /><br />
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,249
Messages
6,171,031
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top