+ Reply to Thread
Results 1 to 6 of 6

Sub Causes Excel to Crash

  1. #1
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Question Sub Causes Excel to Crash

    I have a series of modules, each with one sub. At the end of one sub, it will call the next to start. I am having a problem with one specific sub in the middle, but I can't figure out why. Everytime it gets to this specific sub, Excel crashes and brings up a window that says, "Microsoft Office Excel is trying to recover your information..." This happens everytime, and the macro never completes. I didnt write the sub any different than the others, yet it is still the only one that fails. Any ideas on common things that may cause this to happen?



    All suggestions are welcome.

    Thanks for looking!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Sub Causes Excel to Crash

    I suspect that you might just need to give us a little more information ... like the code.

    It's a bit like walking into a garage and saying your car breaks down but only at a certain time of the day and/or on a particular route. No car, no diagnosis.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Sub Causes Excel to Crash

    Thanks for your response. So a previous sub copies a table into the "REPORT" worksheet on this workbook. I then use the match function to identify columns within this table. I also add helper columns. After the helper columns are added, I then filter the table as needed. Columns are then copied over to a seperate worksheet within the workbook, which creates a report. I have various other subs like this one that create other reports within the workbook, but this is the only one that is causing Excel to crash.

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Sub Causes Excel to Crash

    it's easier to rcv help if you upload a test file having some of your subs, such as msgbox instead of yr code, but that sub which crashes excel...perhaps you can create the erorr
    Last edited by john55; 12-04-2013 at 12:41 PM. Reason: OP has posted code
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  5. #5
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Sub Causes Excel to Crash

    So after stepping through one line at a time, it seems to be crashing at this line every time:

    Please Login or Register  to view this content.
    It's weird because if I drag the prompt to skip over it, then it doesnt crash. If i remove the line, it still crashes at that same spot... i dont get it. Does this help anyone understand what may be occurring?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Sub Causes Excel to Crash

    If you get an error at that point, it probably means that it isn't finding the thing that it's trying to match. In this case, the text "WORKBASKET". That probably means that whatever is on the worksheet isn't exactly the same as what you're looking for ... maybe a trailing space.

    You could check and fix the data or put an * on the end of the text you are searching for to wildcard it.

    If it's not that, please don't ask the question again without posting a sample workbook that demonstrates the problem.

    Regards, TMS

+ 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 2007 : Excel Crash On Save
    By aussiemcgr in forum Excel General
    Replies: 0
    Last Post: 07-27-2010, 01:04 PM
  2. excel vba causes crash
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2010, 05:34 PM
  3. [SOLVED] Excel Crash - Help!
    By Delbert in forum Excel General
    Replies: 13
    Last Post: 12-13-2005, 06:10 PM
  4. Excel VBA macro crash
    By Patrick in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2005, 11:05 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