+ Reply to Thread
Results 1 to 5 of 5

Macro causing excel to crash regularly

  1. #1
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Macro causing excel to crash regularly

    Hi all.

    VBA part-timer here.

    i've been using the following code to track updates on a row by row basis in a table

    Please Login or Register  to view this content.
    this works perfectly - however i seems to be causing excel to crash regularly, and also seems to be running slow.

    i'm thinking it has something to do with defining the values. i'm really not sure where to start with this one.

    any assistance is appreciated.
    Last edited by JBeaucaire; 10-12-2016 at 12:50 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Macro causing excel to crash regularly

    Nuthin wrong with that, if it's crashing Excel I'd reinstall Office....and maybe Windows too.

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Macro causing excel to crash regularly

    I'd tend to disagree - both that there's nothing wrong with it and that it works perfectly.

    The basic problem with the code is that, as posted, it will cause a cascading event.

    You change a cell, the code changes the cell in Col P of that row. That raises another Change event which changes Col P, which raise another Change event and so on. Excel will crash... in about 100 milliseconds.

    You should disable Event handling if changing a cell in the Change event...
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Macro causing excel to crash regularly

    Doh. Yep, the event will cycle unless events are turned off.

    What he said.

  5. #5
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Re: Macro causing excel to crash regularly

    Quote Originally Posted by cytop View Post
    I'd tend to disagree - both that there's nothing wrong with it and that it works perfectly.

    The basic problem with the code is that, as posted, it will cause a cascading event.

    You change a cell, the code changes the cell in Col P of that row. That raises another Change event which changes Col P, which raise another Change event and so on. Excel will crash... in about 100 milliseconds.

    You should disable Event handling if changing a cell in the Change event...
    Please Login or Register  to view this content.
    Yep that did the trick.

    Thankyou so much, it really was causing my brain to hurt.

+ 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 causing excel 2010 to crash
    By bradleyandrewdavis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2015, 09:44 AM
  2. Macro causing excel to crash
    By bradleyandrewdavis in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-16-2015, 04:29 AM
  3. [SOLVED] object invoked error causing excel to crash
    By edopts in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-11-2014, 12:55 PM
  4. ClearContent Macro causing Excel crash.
    By Phily915 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-23-2014, 12:54 PM
  5. Before_Close code causing excel to crash and burn
    By quirkylwj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 12:08 PM
  6. VBA Macro Causing Excel To Crash - Can it Be More Efficient?
    By LoggersAW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2013, 08:49 PM
  7. Macro Glitch Causing Crash
    By Danimagus in forum Excel General
    Replies: 1
    Last Post: 06-06-2005, 02:05 PM

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