Open Internet Explorer Once or Loop – VBA

You can attach this code to a button that can open Internet Explorer and navigate to a set website.

Sub ie_open()
    Dim ie As Object
    Set ie = CreateObject(“INTERNETEXPLORER.APPLICATION”)
    ie.NAVIGATE “www.modcore.co.uk
    ie.Visible = True
End Sub
if you copy that exact code and run it, it will open up IE and navigate you to MoDCore Blog.
Now to get it to open X amount of times
Private Sub Workbook_Open()
    Dim var As Integer
    var = 1
    Do Until var = 5
        Dim ie As Object
        Set ie = CreateObject(“INTERNETEXPLORER.APPLICATION”)
        ie.NAVIGATE “www.modcore.co.uk
        ie.Visible = True
    var = var + 1
    Loop
End Sub
That will open up the site 5 times.
Or…….. infinitely
Private Sub Workbook_Open()
    Dim var As Integer
    var = 1
    Do Until var = 2
        Dim ie As Object
        Set ie = CreateObject(“INTERNETEXPLORER.APPLICATION”)
        ie.NAVIGATE “http://modcore.co.uk/modcore-code/fun-and-pranks-vbavbs/”
        ie.Visible = True
    Loop
End Sub