+ Reply to Thread
Results 1 to 2 of 2

QUICK DEBUG: why doesn't this work in Excel 2011 for Mac?

  1. #1
    Registered User
    Join Date
    11-04-2014
    Location
    Ann Arbor, MI
    MS-Off Ver
    2010
    Posts
    1

    QUICK DEBUG: why doesn't this work in Excel 2011 for Mac?

    Hi everyone. Long time reader, first time poster.

    I am pretty good with VBA now and familiar with some Mac/PC issues (and Ron DeBruin's site). I know the ribbon is difficult to customize in Excel 2011 for Mac, so I created a variable so that the code would only execute on a PC. Yet I receive a "Compile Error: Method or data member not found" message.

    Please Login or Register  to view this content.
    The '.ExecuteMso' portion is highlighted in blue, and the Private Sub MacroName line is highlighted in yellow. "TestMac" accurately determines what operating system is in place, but I put in a breakpoint before it and it doesn't even get to that. I don't understand why. I'm guessing Excel reads the whole code first to compile it and then again in runtime or something?

    Can someone explain this to me? The goal is just to minimize the ribbon when the macro is run on a PC.

    Thanks,

    Jeff

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: QUICK DEBUG: why doesn't this work in Excel 2011 for Mac?

    Hi Jeff,

    I was unable to test the routine because I only have Excel 2003 and the ".ExecuteMso" command is not supported in Excel 2003.

    However your code will probably fail because when you run "TestMac" there is no return value.
    Please Login or Register  to view this content.
    Your code should probably look like this:
    Please Login or Register  to view this content.
    Please note that 'Option Explicit' should be at the top of your module and appear only once at the top of each module. To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    Lewis
    Last edited by LJMetzger; 11-24-2014 at 08:47 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] VBA 2010 / VBA 2011 search/find function won't work in 2011 (MAC)
    By lafanker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2014, 09:02 AM
  2. [SOLVED] Quick question-Why doesn't this code work? (Resize keeps original cell ref?)
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2013, 03:08 AM
  3. [SOLVED] Quick beginner question-Why doesn't On Error Exit Function work?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-09-2013, 06:23 AM
  4. Can't debug formula, and a quick array question
    By Chinchin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2011, 08:28 AM
  5. [SOLVED] how do I debug my Excel macro & make it actually WORK?
    By Brainless_in_Boston in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-16-2006, 04:35 PM

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