+ Reply to Thread
Results 1 to 3 of 3

Macros created in Excel for MAC 2011 work in Excel 2007 but not in Excel 2013?

  1. #1
    Registered User
    Join Date
    03-07-2016
    Location
    London, England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    2

    Unhappy Macros created in Excel for MAC 2011 work in Excel 2007 but not in Excel 2013?

    Hi guys,

    I have written some vba code for a quotation calculator. This was my first time using macro and vba, so it was quite a challenge. After two weeks I got it to work perfectly on my MAC, but once I sent it out for my team to test, I realise that the macros do not work on some newer versions of Excel.

    Can someone please help me to fix this and get it to work on all Excel versions?

    Firstly, I have a start sheet asking people to enable macros, and this disappears once they do so. It also includes a code that can protect and unprotect the worksheets. These codes seems to work on all Excel versions:

    Please Login or Register  to view this content.


    Next I have code that when a button is pressed, a new table and button is created. This works on Excel for MAC 2011 and Excel for Windows 2007, but not any newer versions... In Excel 2013, when the button is clicked, it says, "Run-time error '1004': Unable to get the buttons property of the Worksheet class".

    This is the code and I have underlined where is gets stuck when I press debug:

    Please Login or Register  to view this content.
    Automatically Sheet 3 is highlighted on the left hand side under Microsoft Excel Objects, even though the active sheet is Sheet 1. If I close the debugger, I am automatically on Sheet 3 (which has no buttons and no macros as of yet). If I go back to Sheet 1 and press the button a second time it works??? It creates the table and new button. If I press it a third time, it does not work and throws up the same error and takes me to sheet 3. If I press it a forth time it works again, and so on?

    I have tried to replace the 'ActiveSheet' with 'Sheet 1' and I get this new error, "Run-time error '1004': Method 'Range' of object'_Worksheet' failed". Now it goes all the way through to my Add Button sub, and gets stuck here:

    Please Login or Register  to view this content.


    It once again highlights Sheet 3 in the debugger, and upon closing the debugger, I am once again on Sheet 3. If I click on Sheet 1 again and press the button it works. Once again it works on even number of clicks, but not on odd number of clicks???

    I have tried deleting all other worksheets except for Sheet 1 and the start 'Enable Macros' sheet. But I get the same errors. The only difference being that it doesn't take me to Sheet 3 upon closing the debugger.

    I have even tried replacing the button, by creating a new button in Excel 2013. But nothing seems to solve the problem.

    Now if you click on the newly created, by the above code, Add Wall button, on the first click it DOES WORK and adds a new row to the table. But on the second click it throws up this error, "Run-time error '-2147024809 (80070057)': The item with the specified name wasn't found". The forth time it works, and the fifth it doesn't, and so on... Here is the code and the point at which it gets stuck is underlined:


    Please Login or Register  to view this content.


    If I change 'ActiveSheet' to 'Sheet1' in this part of the code, I can click the button, no errors appear, the screen moves for a second, but in the end nothing happens?

    I have tried adding in error handling, and this just stops the run-time error pop up from showing up, but the buttons only ever work every second click, which still is not good enough.

    Please forgive me if I haven't written my code in the correct format, I am just not sure how to???

    Please can someone help me solve this ASAP!

    Thank you!

  2. #2
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,491

    Re: Macros created in Excel for MAC 2011 work in Excel 2007 but not in Excel 2013?

    Cross-posted at: http://www.mrexcel.com/forum/excel-q...ws-2013-a.html
    Please read the Cross-Posting policy in rule #8: http://www.excelforum.com/forum-rule...rum-rules.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    03-07-2016
    Location
    London, England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    2

    Re: Macros created in Excel for MAC 2011 work in Excel 2007 but not in Excel 2013?

    Quote Originally Posted by macropod View Post
    I am sorry, I have posted this question on two other forums:
    http://www.ozgrid.com/forum/showthread.php?t=198940
    http://www.mrexcel.com/forum/excel-q...ws-2013-a.html

    Only because I am desperate for help as I need to finish this project soon. I did not mean to break forum rules on any of the forums!

+ 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. Macro = Mac NO (Macros Don't Work in Excel for Mac 2011)
    By Merf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2015, 01:50 PM
  2. Macros written in Excel 2010 don't work in Excel 2013
    By Bukovnik in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-03-2015, 01:24 AM
  3. Macros work perfectly in Excel 2010 but generate some errors in Excel 2013
    By Mumps1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2015, 12:45 PM
  4. [SOLVED] Using VBA written created with excel 2013 in excel 2007
    By Aris in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-08-2014, 05:29 AM
  5. Code created in Excel 2010 does not work with Excel 2013
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 10:14 AM
  6. Replies: 1
    Last Post: 05-16-2012, 09:57 PM
  7. Replies: 0
    Last Post: 02-01-2010, 09:45 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