+ Reply to Thread
Results 1 to 1 of 1

What do I need to change a macro created in Excel/Win 2010 so it Runs on Excel/Mac 2011?

  1. #1
    Registered User
    Join Date
    01-14-2016
    Location
    Washington DC
    MS-Off Ver
    2010
    Posts
    2

    What do I need to change a macro created in Excel/Win 2010 so it Runs on Excel/Mac 2011?

    I created the Macro below in Excel 2010 for Windows that runs well, but when I run it in Excel for Mac 2011 I get an error on the ".Web" commands. Is there a place where I can see the list of commands for both the windows version and the Mac version?

    A bit of background on of what the Macro does.

    The Macro downloads financial data from stocks, which symbols listed in column H. The data of interest is in certain tables only, not all of them, so the command ".webtables". This data is copied to another section of the spreadsheet, the data is cleared and it continues until the list of symbols is exhausted.

    Errors encountered:
    At line below, the Macro stops and Excel closes the workbook.
    .Name = "Yahoo analyst estimates"
    Changing above line to
    .Name = False
    allows macro to continue But none of the ".web" commands below are not interpreted.

    So my key issue is to find the list of ".web" like commands for Excel for Mac 2011.
    Sorry for the long explanation.

    ' Download_Yahoo_Metrics Macro
    ' Downloads Tables for Analyst Estimates, Analyst Opinion and Key Statistics
    '
    Dim ScrURL As String
    lr = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row 'delimits the last row
    fr = ActiveSheet.Cells(1, "C") 'delimits the first row
    For r = fr To lr
    Range("B5:F53").ClearContents 'clear previous
    ScrURL = "URL;http://finance.yahoo.com/q/ae?s=" & ActiveSheet.Cells(r, "H")
    '
    With ActiveSheet.QueryTables.Add(Connection:=ScrURL, Destination:=Range("B5"))
    .Name = "Yahoo analyst estimates"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = False
    .RefreshPeriod = 0
    .WebSelectionType = xlSpecifiedTables
    .WebFormatting = xlWebFormattingNone
    .WebTables = "8,11,14,17,20,23"
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = True
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    End With
    With ActiveSheet
    .Cells(r, "i") = .Range("C47")
    .Cells(r, "j") = .Range("D47")
    .Cells(r, "k") = .Range("F47")
    .Cells(r, "l") = .Range("C48")
    .Cells(r, "m") = .Range("C49")
    .Cells(r, "n") = .Range("D49")
    .Cells(r, "o") = .Range("F49")
    End With
    Next
    End Sub
    Last edited by juliomaz; 01-14-2016 at 11:39 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Created XLSM in Excel 2013, Customer Makes Change in Excel 2010 -> VBA,Formatting Errors
    By JPFold in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-13-2014, 09:51 AM
  2. Macro created in excel 2010 and compatible with excel 2003.
    By Tinong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2013, 11:24 AM
  3. Excel 2010 arithmetic operations on newly macro created pivot table
    By love0126 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2013, 02:08 PM
  4. Validation list from Mac Excel 2011 fails to function on Windows 7 Excel 2010
    By lhlevasseur in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 12-17-2012, 07:08 PM
  5. Replies: 2
    Last Post: 11-26-2012, 08:33 AM
  6. Code works in Windows excel 2003 and 2010 but crashes in Mac excel 2011
    By kiweed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2012, 08:46 PM
  7. Will a Macro created in excel 2007 work in the 2010 environment?
    By mprmanzano in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2012, 06:33 AM

Tags for this Thread

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