Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Unanswered: followHyperlink question

    Hello all,
    From Excel I'm trying to send a URL to a web page, which returns an embedded Excel document, copy the data out and paste it into my current Excel workbook. The problem is that after the followHyperlink, a Columns("A:G").Select grabs the data on my Excel worksheet, not on the IE object worksheet. I can't figure out how to activate the IE Excel WS so I can do the select data and copy. How do I toggle between the IE and Excel application or window.

    Here is an example:

    Sub openWebGetData()


    ActiveWorkbook.FollowHyperlink _
    Address:="http://table.finance.yahoo.com/table.csv?s=INTC&a=07&b=9&c=2003&d=09&e=12&f=2003& g=d&ignore=.csv", _
    NewWindow:=True


    Application.Windows(1).ActiveWindow 'I know this is wrong


    Columns("A:G").Select
    Selection.Copy
    Windows("MyFlie.xls").Activate

    Sheets.Add
    ActiveSheet.Paste

    ActiveWorkbook.Close


    End Sub

    Thanks in advance for the help, bjhulce@comcast.net

  2. #2
    Join Date
    Oct 2003
    Posts
    1
    A better idea is to create an iqy file something like this:

    WEB
    1
    http://table.finance.yahoo.com/table.csv?s=INTC&a=07&b=9&c=2003&d=09&e=12&f=2003& g=d&ignore=.csv
    Formatting=All
    PreFormattedTextToColumns=False
    ConsecutiveDelimitersAsOne=False
    SingleBlockTextImport=False
    DisableDateRecognition=False

    and let it populate your web pages. Or, using ASPTear, you could do something like this:

    'Build the retrieval call
    Set ASPtearObject = CreateObject("SOFTWING.ASPtear")
    MyURL = "http://table.finance.yahoo.com/table.csv?s=INTC&a=07&b=9&c=2003&d=09&e=12&f=2003& g=d&ignore=.csv"
    RetrievalString = ASPtearObject.Retrieve(MyURL, 1, MyFormFields, "", "")

    Both of these work for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •