+ Reply to Thread
Results 1 to 10 of 10

Macro causing excel to crash

  1. #1
    Registered User
    Join Date
    03-22-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Macro causing excel to crash

    I am building a file to track various things at the golf course. One of which being handicap. Part of the file has two tables. One with 20 rows for the score listing and another on another tab for archived scores. I am running a macro to insert a new table row into the first table, copy the then 21st entry into the archive table, then delete the 21st row of the first table. When I tested it first, it ran with no issues. When I plugged more data in and tried it again, it crashed. I can't figure out why or how to fix it. Does the starting cell when recording the macro matter (if the table begins in B2, would it matter if the selected cell is A1 or B2 when beginning the recording of the macro)? Or would the selected cell matter when using the keyboard shortcut to run the macro (in B2 - the first cell of the table, or any other cell in the workbook)?

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro causing excel to crash

    If you're using recorded code then you're pushing it uphill. You will be very lucky to have that code do anything other than what it was recorded for.
    Have you got an example workbook?

  3. #3
    Registered User
    Join Date
    03-22-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Re: Macro causing excel to crash

    But all I want it to do is what I'm recording it to do. I'm at work now, I will work on uploading a copy with just the tables I'm trying to work with. Does the cell selection before I run it need to match the cell selection when the macro recording began?

  4. #4
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro causing excel to crash

    Yes the conditions have to be exactly the same, or you'll get an error

  5. #5
    Registered User
    Join Date
    03-22-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Re: Macro causing excel to crash

    So if the table is, say B2:E10, and I start recording the macro with cell A1 selected, I need to select A1 before running the macro? Does the fact that it involves tables change the procedure at all?

  6. #6
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro causing excel to crash

    The tables shouldn't make any difference provided they're in the same place & the same size, the macro does the same thing every time.
    It's impossible to say exactly what's happening without an example workbook

  7. #7
    Registered User
    Join Date
    03-22-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Re: Macro causing excel to crash

    I actually re-posted the question in the "macro" specific section. I didn't realize there was a space for these issues outside of this formula section. I attached a file there. Here is the link:

    http://www.excelforum.com/excel-prog...-to-crash.html

  8. #8
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro causing excel to crash

    Cross posting/Double posting is a big no no, especially without the links so we're aware of it

    I'll have a look a bit later on today

  9. #9
    Registered User
    Join Date
    03-22-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    51

    Re: Macro causing excel to crash

    Thanks. I'm certainly not trying to ruffle any feathers. I've misplaced posts before by mistake. I realized I misplaced this one after the fact but couldn't find where to delete this thread.

  10. #10
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro causing excel to crash

    Hi Bradley, Check the other thread

+ 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] 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
  2. ClearContent Macro causing Excel crash.
    By Phily915 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-23-2014, 12:54 PM
  3. 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
  4. 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
  5. 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