+ Reply to Thread
Results 1 to 5 of 5

Program Crashes Under Load

  1. #1
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Program Crashes Under Load

    My apologies for an “amorphous” question. I developed an application for my customer that works just fine. In about one out of 30 runs, it crashes without an error message.

    The part of the program that is malfunctioning is that which reads a directory of files. It opens them, reads rows of data, puts them into a table and closes the file.

    The “crash” only seems to happen when the system is under load. The nature of the crash is that it opens the file and stalls. It is usually part way through the files in the directory when it does this.

    I have Application.Screenupdate = FLASE at this point. I do not see the other files opening and closing.

    The frustrating part is that I can’t duplicate the problem.

    Short of telling the customer to reduce the load on their computer is there anything else I can do?

    I had a similar problem a couple of years ago when copying and pasting pictures. However, in that case, the program produced and error that I trapped and re-ran the subroutine recursively until the “all clear: and the copy was successful.

    I am wondering if there is something I can trap here

    The program has too much proprietary data in it to sanitize. The best I can do is post the code.

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: Program Crashes Under Load

    Hi dflak,

    I'd try to throw in some DoEvents in the code. This allows the code to wait for the OS to perform other tasks and come back to the code.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,301

    Re: Program Crashes Under Load

    As above and maybe something like a code below ... something in this direction:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,032

    Re: Program Crashes Under Load

    Hey there dflak...
    puts them into a table and closes the file.
    I'm guessing your issue is caused by the above...
    Try changing your Tables to Ranges or change your code to Listobject specific referencing...
    Also, no need for all those loops...
    Also, perhaps ideal to process all the data in memory and then write back to sheet...
    Can only ascertain with a sample though...
    Last edited by Sintek; 07-30-2024 at 07:53 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Program Crashes Under Load

    Thanks for all the responses. The DoEvents will be the easiest to implement.

    I get the comments on the loops. They are afterthoughts. I am still discovering new ways that the data can be dirty and has to be cleaned up. I may pull that code out into a separate module and clean it up. These loops occur after the file data are imported.

    The requirements are still a work in progress.

    As for using ranges instead of tables. The data will have to be put into a table eventually. I suppose I can import it into a range and when it's all done, copy the range into a table. That might actually be quicker since the table has an number of columns that do calculations. Might as well do that all at once instead of incrementally. Don't import and try to think at the same time.

    Food for thought.

+ 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. Sheet with userform crashes on load. Possible issue with VBE7.dll
    By dude2007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2012, 08:32 PM
  2. ARC Sin in VBA so that program never crashes
    By bmr8002 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2012, 06:42 PM
  3. excel macro crashes when external program runs calculations
    By aileen_magee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2011, 09:51 AM
  4. External Links cause program crashes
    By vheying in forum Excel General
    Replies: 12
    Last Post: 08-18-2009, 08:20 AM
  5. Excel crashes when I load help
    By ramparts in forum Excel General
    Replies: 1
    Last Post: 10-29-2006, 07:32 AM
  6. Excel 2004 crashes on update/insert/load query
    By jolly in forum Excel General
    Replies: 0
    Last Post: 11-17-2005, 02:10 AM
  7. Using XLA to load VBA program
    By NoviceDeveloper in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2005, 04: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