[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Problem with Excel Web Querys of Yahoo Finance Stock Data

Asked by mjpalma in Microsoft Excel Spreadsheet Software

Tags: yahoo, excel, data, from, query

I am trying to automatically grab various stock data from Yahoo finance.  I wrote a macro for each page I want to grab data from, for example:

http://finance.yahoo.com/q/ks?s=IT or http://finance.yahoo.com/q/is?s=IT&annual

The macros first clear out the target worksheet, including the query from a previous run of the macro and then designates that the data is to be returned to cell A1, and in fact it selects A1 before going onto creating the web query for the current iteration.    At the end of this message is an example of the macro for the first sample page listed above

There are about 10 web pages I am trying to get data from, and their is a macro for each page, and I wrote one macro to run each of these 10 individual macros.  (I am concerned that the ubber macro is going onto a new page before the previous query is completed and this may add some headaches and would like your imput on this)

Anyways, some tables are grabed and placed in their worksheets as designed every time.  But in other worksheets, such as the pages listed above and in the macro example included, the performance is much more mixed.  In some cases they work fine, but other times some combination of 1) the data is returned to the wrong location within the worksheet 2) the wrong table or Item from the page is returned 3) no data is returned 4) only part of the desired table is returned.

When I went into the edit query function, sometimes the correct tables are marked for importation, some times they are not.  There does not seem a pattern.  I dont understand why this is happening, I recored each of these macros and they worked fine before I save the macro, so it should be returning the same data, the same way each time, but this is not happening.

I searched the MS KB and they mentioned that Dynamically Scripted Tables may be interfering with the query, if this is the case is there a solution to this problem?

Would it be better to right a macro/query for each individual table I want to grab?  Though there are problems with macros/queries associated with pages where I am only going after a single table on that particular page.

The key is to retrieve the right data reliably to the correct location, any help would be greatly apprecciated.

Example Macro-
Sub keystats()
'
' keystats Macro
' Macro recorded 10/18/2004 by Michael J. Palma
'


'
'Setup worksheet

    Sheets("keystats").Select
        Cells.Select
    Selection.clear
    Selection.QueryTable.Delete
   
'    Range("A:A,B:B").Select
'    Range("B1").Activate
'    Selection.Delete Shift:=xlToLeft
'    Range("A1").Select
'    Selection.EntireColumn.Insert
'    Selection.EntireColumn.Insert
    Range("A1").Select

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://finance.yahoo.com/q/ks?s=IT", Destination:=Range("A1"))
        .Name = "ks?s=IT_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlOverwriteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "26,31,34,37,40,43,46,53,56,59"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub



[+][-]11/02/04 08:28 AM, ID: 12474217Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: yahoo, excel, data, from, query
Sign Up Now!
Solution Provided By: jeverist
Participating Experts: 3
Solution Grade: A
 
[+][-]11/03/04 04:09 PM, ID: 12488865Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/04 11:22 PM, ID: 12490809Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/04 04:31 AM, ID: 12492848Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/04 11:31 AM, ID: 12497219Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/04 01:41 PM, ID: 12498576Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/17/05 08:41 AM, ID: 14019655Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/13/05 08:01 PM, ID: 15082758Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81