+ Reply to Thread
Results 1 to 4 of 4

VBA: performance problem, Excel not responding

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    VBA: performance problem, Excel not responding

    Hello,

    I have an Excel performance problem while executing VBA.
    My guess is that this may be related to the high volume of lines to be treated (approx. 100,000) in 1 file (A), however, this did not occur before. Would this be a reason why Excel stops responding?
    How can I find out the rootcause during this execution? It seems that the new lines that are written in file B, based on file A, stall and that the last line keeps repeating.
    Thank you for your help.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: VBA: performance problem, Excel not responding

    It is hard to tell without your code (even then it is often hard to tell without your workbook).

    Assuming you're looping, you can add:

    Please Login or Register  to view this content.
    Inside your loop, and instead of "Show That I'm Working!" have it equal a loop counter. Then run your macro from your workbook (and not from the VB editor) and you will see in the bottom left corner your loop counter.

    On the other hand, if what you suspect is true, the last few lines of your code which keeps looping while not doing anything needs to be inspected.

  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: VBA: performance problem, Excel not responding

    As StevenM says:

    It is hard to tell without your code (even then it is often hard to tell without your workbook)
    Give us something to look at, to take away any guessing as to exactly what your problem could be.
    Last edited by Winon; 06-11-2012 at 01:55 PM. Reason: Problem with Text Quotes
    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
    Registered User
    Join Date
    02-13-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: VBA: performance problem, Excel not responding

    Thank you both for your suggestions and feedback.

    I'm going through my code in steps, adding stops and at times going step by step using F8.
    I also added your suggestion Steven with a loop counter. It seems that this is difficult though, because I'm using various files (1 for sourcing and 1 newly created) and the loop counter doesn't seem to know what to count, even though I put in the correct unique identifier. (So Excel shows "Identifier1" instead of the counter.)
    Here are more details of the As Is situation: I'm going through 2 loops and both give me the message of 'Excel not responding'. So I'm wondering if there is a way to go through the loops in batches, meaning for example per 10K lines for a total of 100K lines (so using 10 steps or repeats). In this case vba would only start the next batch of 10K lines when the previous one is finished. It seems that in that case Excel would be able to handle this?
    Any advice is very much appreciated. Thank you.

+ 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