+ Reply to Thread
Results 1 to 14 of 14

All Macros broken

  1. #1
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    All Macros broken

    All the macros I have created have seemed to stop working for both me and my coworkers.

    Seems like even "End Sub" is causing code to be interrupted.

    I poked around about the 2014 update issues but I believe we should be past any of those issues.

    Any guidance on where to start looking is highly appreciated.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,010

    Re: All Macros broken

    No way to know without seeing your macros. Even better, can you attach your file? Are you getting compile errors or runtime errors? What error message are you getting when the code is interrupted?

    Anything else in your environment change when the problem started? How are you sharing your macros with your co-workers?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: All Macros broken

    Its the gray screen that says code execution has been broken.
    In some of them I can continue through after going to the debugger in others it gets hung up.

    This one gets hung up on the first "End With"

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by 6StringJazzer; 12-08-2015 at 05:53 PM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,010

    Re: All Macros broken

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,010

    Re: All Macros broken

    Whenever execution stops, the "gray screen" has an error message on the first line. What's the error messag?

  6. #6
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: All Macros broken

    "Code execution has been interrupted"

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: All Macros broken

    Hi Shecansueme,

    See if replacing this line of code at the start of your code...

    Please Login or Register  to view this content.
    ...with this does the trick:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  8. #8
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: All Macros broken

    Try this when you get 'Code execution has been interrupted':

    Press 'Debug', then Ctrl-Break twice. Press F5 to continue and save.

  9. #9
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: All Macros broken

    Thanks for the help on this. Adding the below code
    Please Login or Register  to view this content.
    this seemed to do the trick on the file I posted.
    I added the same code to other macros and it worked. But on another it doesn't display 'Code execution has been interrupted' but now freezes somewhere around the paste code I think.
    Please Login or Register  to view this content.
    Overall I'm a little confused as to why this all started to happen all of a sudden.

  10. #10
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: All Macros broken

    While
    Please Login or Register  to view this content.
    does prevent the 'Code execution has been interrupted' message, it also prevents you from using Ctrl-Break to debug your code.

  11. #11
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: All Macros broken

    If I remove
    Please Login or Register  to view this content.
    Excel still freezes halfway through and if given time to recover shows that it broke around:
    Please Login or Register  to view this content.
    Is there something in my environment that may have gotten changed that is causing all of these issues?

  12. #12
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: All Macros broken

    Just glancing at your code, you are doing a lot of activating and selecting, which is unnecessary and slows your code down.

    Also this line:
    Please Login or Register  to view this content.
    Selects every cell on a worksheet, which is probably causing your computer to be unhappy. I would suggest referring to actual ranges that need to be copied and not using activate and select and especially not selecting and copying every cell on a worksheet.

  13. #13
    Registered User
    Join Date
    03-02-2012
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: All Macros broken

    Thanks for the help skywriter I'll definitely try and trim it down. But it had been running smoot
    I spoke with our IT department and they did make some updates through security patches over last weekend. They claim nothing should have been changed in Excel, but I wonder if it was something inadvertent to change Excel.

  14. #14
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: All Macros broken

    I don't think this is a problem you will get to the bottom of, unfortunately. I've seen this issue every so often on every version of Excel I have used over the past decade or so. Ctrl-Break twice plus F5 fixes it for me when I come across it. Before I learned that trick, resetting the computer would also generally fix it.

    I second skywriters comments on selecting, activating, etc... I would also add that when working with more than one workbook or worksheet, it is very important to clearly identify which workbook or worksheet a range is part of. This might help get you started:

    Please Login or Register  to view this content.

+ 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] Macros broken from 2010 to 2013 - example macro inside
    By OfTheNaveed in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-13-2014, 11:27 AM
  2. Broken in, In Just Two Weeks
    By Doc Snowfox in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-11-2013, 03:31 PM
  3. URGENT: Excel 2007 Macros Broken!!!!!
    By JaedenRuiner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2012, 11:47 AM
  4. Password protected macros are broken
    By gwendolyn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2007, 09:30 PM
  5. [SOLVED] broken links
    By Doug T in forum Excel General
    Replies: 6
    Last Post: 11-19-2005, 08:45 AM
  6. [SOLVED] i think its broken
    By littlemcl in forum Excel General
    Replies: 1
    Last Post: 10-07-2005, 09:05 AM
  7. [SOLVED] Reinstalled excel, macros broken
    By Rick Campbell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2005, 11:05 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