Results 1 to 1 of 1

Excel VBA and morningstar problem with table

Threaded View

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    1

    Excel VBA and morningstar problem with table

    Hi,

    I have a problem with my table. Everything is in one column

    Module:
    Sub GetStockIncome(ByVal destination As String, ByVal sheetprint As String, ByVal cellprint As String, ByVal cellprintend As String)
    '
    ' GetStockIncome Macro
    ' Macro to get Income statement
    '
    ' Keyboard Shortcut: Ctrl+g
    '
    '
        Dim Symbol As String
        'Settings the right sheet
        Symbol = Sheets("Parametres").Range("ticker").Value
        Sheets("Fundamental").Select
    
        Dim QuerySheet As Worksheet
        Dim DataSheet As Worksheet
        Dim qurl As String
        Dim i As Integer
        
        Application.ScreenUpdating = False
        Application.DisplayAlerts = False
        Application.Calculation = xlCalculationManual
        
        Set DataSheet = ActiveSheet
    '
    ' Clear part of column E and build Yahoo download URL using contents of column A.
    '
    
        qurl = "http://financials.morningstar.com/ajax/ReportProcess4CSV.html?t=" & Symbol & "&region=USA&culture=en_us&reportType=" & sheetprint & "&period=12&dataType=A&order=asc&columnYear=5&rounding=3&view=raw"
    
    '
    ' Display request URL (if uncommented).
    '
    '  Range("c41") = qurl
    '
    ' Request URL data be loaded to Column E
    '
    QueryQuote:
                 With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, destination:=DataSheet.Range("" & cellprint & ""))
                    .BackgroundQuery = True
                    .TablesOnlyFromHTML = False
                    .Refresh BackgroundQuery:=False
                    .SaveData = True
                End With
                
                Range("" & cellprint & ":" & cellprintend & "").TextToColumns destination:=Range("" & cellprint & ":" & cellprintend & ""), DataType:=xlDelimited, _
                    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
                    Semicolon:=False, Comma:=True, Space:=False, other:=False
    
    '
    ' Turn calculation back on
    '
        'Application.Calculation = xlCalculationAutomatic
        'Application.DisplayAlerts = True
    '
        'Range("A1").Select
    End Sub
    The code:
    Call GetStockIncome("Fundamental", "is", "$A$1", "$A$27")
    Last edited by pob944; 01-12-2014 at 08:03 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How can I query Morningstar if I have a user ID and Password
    By jpattavina in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2013, 09:17 AM
  2. Problem with excel table please help
    By Adam Miles in forum Excel General
    Replies: 1
    Last Post: 07-10-2012, 04:54 AM
  3. Login to morningstar
    By max3732 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2011, 05:34 PM
  4. Excel Table problem
    By emad1001 in forum Excel General
    Replies: 7
    Last Post: 07-08-2008, 06:12 PM
  5. [SOLVED] Formatting financial data from Morningstar
    By Gallardo in forum Excel General
    Replies: 3
    Last Post: 12-13-2005, 09:50 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1