Results 1 to 8 of 8

Excel Freezes and Crashes During Do Until Loop If Ran More Than Once

Threaded View

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    15

    Excel Freezes and Crashes During Do Until Loop If Ran More Than Once

    I set up a vba macro a couple of years ago that formats a report pulled out of OneSoure, and it has worked well for me, but if the myself or another user runs it more than once while in the same instance of Excel, Excel freezes and gives the "Excel is not responding" message and I have to close it in task manager. You can save the file and excel after running it once and then when you reopen it you can run the macro again with no issues (unless again you try running it a second time). I have tried using F8 to go line by line to find the exact spot where it crashes and it works for me when I do that, but the minute I try to run it, it freezes up in the Do Until Loop, I haven't been able to pinpoint exactly, but I believe at the Selection.Columns.AutoFit line.

    Full disclosure, this is sub that is called by another sub. I have attached a copy of the report the code below would be used to format, each report typically has 8-16 tabs that would be processed by one of 5 subs. When I run the macro, it takes about 50 seconds to process the full workbook (5 seconds to actually execute the code and the remaining 45 seconds is the time it takes to make the changes to page setup.

    Does anyone have any thoughts on how I can fix my loop? (btw, I use Excel 2013 and my coworkers use Office 365)
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Export function freezes during second iteration of the loop
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2018, 06:18 PM
  2. Large VBA Loop - Sometimes crashes!
    By Exodus_NZ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2018, 07:00 AM
  3. Loop code crashes when it encounters blank cell in middle of data.
    By Mott31 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 06-28-2016, 02:04 PM
  4. [SOLVED] freezes on loop - copying and pasting to different page
    By bigred101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2015, 01:32 AM
  5. For loop crashes Excel when filling a cell range with string value
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 09:41 AM
  6. Loop Macro Crashes excel 2010
    By jmoon3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2012, 07:57 PM
  7. Macro loop crashes excel?
    By Lagitup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2008, 10:30 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