+ Reply to Thread
Results 1 to 7 of 7

Excel crashes erratically after running a macro

  1. #1
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Question Excel crashes erratically after running a macro

    Hello Experts,

    I have developed a model for a client which keeps crashing after being used a few times. The crash is major! Excel shuts down and asks to send an error report.

    This can happen after being run anywhere from 3 to 20 times. (Clicking a POST button which transfers items to a "database" type sheet).

    I developed the model on a PC using Excel 2010. When this was loaded on a Mac, the user tells me that it happened periodically, and I have seen is occasionally on my PC as well.

    However, the workbook has now been loaded on a server, with users across the state of Victoria accessing via Sharepoint - most using Excel 2007. Now it is happening very frequently.

    I don't think the macro is at fault, it doesn't go into debug. Excel just seems to GIVE UP.

    Have you seen this kind of thing before? Is there a way of "flushing buffers" or something so that Excel can keep working?

    I am reluctant to post the model because it is full of personnel details, and is 2.5mb.

    Any clues would be appresiated!

    Regards,

    David

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Excel crashes erratically after running a macro

    I strongly believe, may events making the action continuously which makes the code to go on continuous looping which results in crashing.

    In the beginning Turn off the events and in the end turn on it and check

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel crashes erratically after running a macro

    Hello David A Coop,

    It is almost like asking, how long is a piece of string.

    Try experimenting by using Application.EnableEvents = False, setting it back to True at the end of your code.

    You may also have various conditions set for the code to execute where it may require "On Error Resume Next"

    Hope that helps.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Excel crashes erratically after running a macro

    Thanks Sixthsense and Winon,

    You both suggested Application.EnableEvents.

    Do you mean to wrap the code in the Event Macros - in my case Workbook_BeforeClose, _BeforeSave and _Open like this:

    Please Login or Register  to view this content.
    I did have one WorkSheet_Calculate event which was not working! I took the lazy approach and entered Exit Sub as the first row, thinking that I would come back and fix the code later. From what you guys have said, I suspect this macro and will delete it. See if it makes a difference.

    Thanks for your help.

    David

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Excel crashes erratically after running a macro

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Excel crashes erratically after running a macro

    Quote Originally Posted by :) Sixthsense :) View Post
    Please Login or Register  to view this content.
    Thank you!

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Excel crashes erratically after running a macro

    Just curious to know, whether it solves your issue?

+ 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. Excel crashes when trying to save one particular xlsm only after running macro
    By duncandhu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2013, 11:10 AM
  2. [SOLVED] Excel Crashes when trying to save after running a sort macro
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2013, 09:23 AM
  3. After saving the spreadsheet and then running the macro, Excel crashes
    By hydronicengr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2012, 08:03 PM
  4. Excel Crashes when saving after running macro
    By msmithdynamicsgp in forum Excel General
    Replies: 0
    Last Post: 10-24-2011, 12:16 PM
  5. Excel crashes after running Macro
    By sjl17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2005, 06:27 AM

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