Internet Explorer automation working on all but 1 computer

MrJimmy

New Member
Joined
Jul 12, 2016
Messages
3
Hi there,

I've been struggling with a problem for a macro that uses IE to open up a webpage and download values from a table to Excel.
The macro works fine on all but 1 of my colleagues computers here at work. I can't figure out why his computer behaves the way it does, as it should have all the same settings and installations as we have (I work at a larger company).

I've cut out some parts of the code below as I know that it is not part of the problem.

For us other users the code works fine, the only thing we see while the macro is running is the progressbar. We can't see the IE-window open up and so on, since its done in the background.
But for the other user, a internet explorer window pops up at the "ie.navigate url" part, and the macro stops at either "IE.Busy" or "IE.Document" since it doesn't seem to know that IE is running..

We have the same versions of excel and internet explorer, windows etc.. Same references are checked in the VBA.. But somehow his Excel can recognize IE.Navigate but after that it can't control the IE-application..

Anyone had a similar problem or have any suggestions for what I can try?

Thanks.

Code:
Sub Grupp_3()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim IE As Object
Dim tbls, tbl, trs, tr, tds, td, r, c
Dim countery2 As Long
Dim ANTAL As Long
Set IE = CreateObject("internetexplorer.application")


On Error GoTo ErrMsg
ActiveWorkbook.Sheets("IMPORT").Select
Range("A239:I306").ClearContents
    
    Radhopp = Range("O31").Value
                
  Set KODER = Range("Q31:Q34")


    countery = 1
    
 ANTAL = 4
UpdateProgressBar 0, ANTAL


    For Each Row In KODER.Cells


    ActiveWorkbook.Sheets("IMPORT").Select


 




IE.navigate " real URL here"




    ' Wait while IE loading...
    Do While IE.Busy
        Application.Wait DateAdd("s", TID, Now)
    Loop




    Set tbls = IE.Document.getElementsByTagName("table")
    For r = 0 To tbls.Length - 1
        Debug.Print r, tbls(r).Rows.Length
    Next r


    Set tbl = IE.Document.getElementById("TABLE_OVERVIEW")
    Set trs = tbl.getElementsByTagName("tr")


    For r = 0 To trs.Length - 1
        Set tds = trs(r).getElementsByTagName("td")
        'if no  then look for 
        If tds.Length = 0 Then Set tds = trs(r).getElementsByTagName("th")


        For c = 0 To tds.Length - 1
            ActiveSheet.Cells(Radhopp, 1).Offset(r, c).Value = tds(c).innerText
        Next c
    Next r

' code continues but problem arises earlier.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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