Compile Error in Mac

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erikasdv
    New Member
    • Jul 2018
    • 4

    Compile Error in Mac

    Hi all,
    I am brand new to VBA/T-SQL so apologies if anything is unclear or it is a stupid question.
    I have the following simple Macro to refresh data in a query table that runs fine on Excel 2016 on my PC:

    Code:
    Sub RefreshVIPData()
    '
    ' RefreshVIPData Macro
    
    '
    ThisWorkbook.Queries.FastCombine = True
    Application.DisplayAlerts = False
    '
        Range("Query1[[#Headers],[AnimRecNo]]").Select
        Application.CutCopyMode = False
        Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
        Application.DisplayAlerts = True
    End Sub
    When I try to run the Macro via a form control button on a colleague's Mac I get the following:
    'Compile error:
    method or data member not found'
    and the debugger highlights the word 'Queries' in the FastCombine command.

    Is this a problem with opening the file on a Mac? Or some other issue within the VBA itself?
    Thanks in advance for any guidance.
  • Nauticalgent
    New Member
    • Oct 2015
    • 103

    #2
    I don't really know much about running VBA on a MAC, in fact I didn't think it was possible with some sort of shell program.

    What I do kind curious is how that particular line is the one that showed on error because it is commented out...

    Comment

    • erikasdv
      New Member
      • Jul 2018
      • 4

      #3
      Hi Nauticalgent, thanks for your reply.
      Apologies I think the ' was just bad copy & pasting!! I have edited the original post to reflect this (thanks for noticing).

      Comment

      • Nauticalgent
        New Member
        • Oct 2015
        • 103

        #4
        I use Office 2013 at work and I brought up a blank worksheet and invoked the VBE to test. Intellisense did NOT offer Queries as a available Method after I typed in ThisWorkBook.

        I did a quick google search and it appears that the Queries Method for ThisWorkBook is only available in Excel 2016, which would explain things.

        Here is the link:


        As a test, on a new line, type in "ThisWorkBo ok." and see what methods intellisense offers. If "Queries" is not one of them, then there is the problem. What Office for Mac version are you using?

        Comment

        • erikasdv
          New Member
          • Jul 2018
          • 4

          #5
          Yes - 'Queries' did appear from intellisense when running your test in Excel 2016.
          The Mac is also using Office 365, Excel 2016.
          I have not tried to set up any kind of ODBC between the two - could that be the problem?
          Thanks.

          Comment

          • Nauticalgent
            New Member
            • Oct 2015
            • 103

            #6
            Not sure of the ODBC connection. I doubt if that is the issue since the error specifically mentions a Method not found.

            It appears you did the test on the PC (which we already know works) and not the MAC. If this is accurate, try it on the Mac. If intellisence offers the Queries Method than I am out of ideas...

            Comment

            • erikasdv
              New Member
              • Jul 2018
              • 4

              #7
              Oops sorry!
              No it does not offer Queries on the Mac so I think you have found the problem - thank you!
              This link states that Power Query is not supported on a Mac so perhaps I'm out of luck :(

              Comment

              Working...