Skip to content

Instantly share code, notes, and snippets.

@jakelosh
Last active October 4, 2023 19:45

Revisions

  1. jakelosh revised this gist Jul 10, 2014. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions vbaNavigateInternetExplorer
    Original file line number Diff line number Diff line change
    @@ -13,12 +13,6 @@ Public Sub NavigateIe()

    'Now we'll load the URL into IE and pull the data
    Dim objIe As Object
    With wksOut
    .Cells.ClearContents
    .Activate
    .Range("A1").Select
    End With

    Set objIe = CreateObject("InternetExplorer.Application")
    With objIe
    .Visible = True
  2. jakelosh created this gist Jul 10, 2014.
    32 changes: 32 additions & 0 deletions vbaNavigateInternetExplorer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    Public Sub NavigateIe()

    'Declare some helpful variables
    Dim wksIn As Worksheet, wksOut As Worksheet
    Dim strTickerArr() As String, varNotionalArr() As Variant, strBloomArr() As String
    Dim strLink As String


    'Set some worksheet names
    Set wksIn = ThisWorkbook.Worksheets("INPUT")
    Set wksOut = ThisWorkbook.Worksheets("OUTPUT")
    Set wksLookUp = ThisWorkbook.Worksheets("Look Up Table")

    'Now we'll load the URL into IE and pull the data
    Dim objIe As Object
    With wksOut
    .Cells.ClearContents
    .Activate
    .Range("A1").Select
    End With

    Set objIe = CreateObject("InternetExplorer.Application")
    With objIe
    .Visible = True
    .Navigate strLink
    Do Until .ReadyState = 4: DoEvents: Loop
    .ExecWB 17, 0 'SelectAll
    .ExecWB 12, 2 'Copy
    End With
    wksOut.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False

    End Sub