+ Reply to Thread
Results 1 to 6 of 6

VBA crashes Excel

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    27

    VBA crashes Excel

    Hi,

    I'm using three different macros in one workbook for a report that brings approximately 30K rows. When using this file to run the macros sometimes it randomly it hangs up or display the message that there is no enough memory to display contents so I have open the start task manager to end Excel program or go to process and force Excel to close. Then, I reopen excel, recover missing files or open the file and run it again so hopefully I can obtain the report that I need, it works when I do this but it is annoying.

    Why will this happen?

    Thank you!

  2. #2
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: VBA crashes Excel

    It is possible you have an infinite loop running or some other error with your code, but it is hard to tell without seeing the code in question or a sample worksheet. Either way, excel 2010 should definitely be able to handle 30k rows of calculations.

    Escape key will cancel any code you have running, if that ends up being the issue it may help to try that one out.

    Does the code work correctly sometimes, or does it never work?
    Last edited by jake.masters; 09-24-2012 at 03:45 PM.

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: VBA crashes Excel

    It works correctly but gets hang up sometimes. At least once every time I use it. See below the code.

    It seems to be what you mention "an infinite loop running". I also see the processors at the bottom right trying to complete to a 100%.

    These macros is a combination of the macro recorder and some code that I wrote.

    See the 2 macros below.


    Thank you!



    Please Login or Register  to view this content.
    Last edited by aurisab; 09-24-2012 at 04:21 PM.

  4. #4
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: VBA crashes Excel

    Please wrap those guys in [ code ] and [ /code ] at the end so they are easier to read. Thanks.

    bracket code bracket
    your code here ...
    and here ...
    bracket /code bracket

    Or...

    Select your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
    Last edited by jake.masters; 09-24-2012 at 04:13 PM.

  5. #5
    Registered User
    Join Date
    09-05-2012
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: VBA crashes Excel

    I just update it.

  6. #6
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: VBA crashes Excel

    It is hard to tell from the code what is causing the problem, as it is mainly recorded stuff...I would consider setting stops in the code to see which portion crashes excel and debugging in that fashion. Set a stop in a particular line of code by selecting a line and hitting F9, which should create a red stop light at the beginning of the line. When you run your code with F5, it will stop here. By breaking the code into pieces and testing it, you can isolate the problem.

    This will help you to figure out which portion of the code is malfunctioning.


    Some additional info:

    http://www.cpearson.com/excel/debug.htm

    You could potentially step through line by line with F8 and see what was causing the problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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