+ Reply to Thread
Results 1 to 4 of 4

Extremely slow VBA macro for mailmerge with Excel and can't control-break

  1. #1
    Registered User
    Join Date
    02-09-2021
    Location
    21701
    MS-Off Ver
    365
    Posts
    3

    Extremely slow VBA macro for mailmerge with Excel and can't control-break

    I got this code off the internet and it works however, it's extremely slow and I can't interrupt it with CTRL-C. I'm just learning VBA and seek expertise in resolving issue. I run this from Word/Mailings/Macro

    In regard to slowness: The screen repaints on every record. It doesn't update with current record, just repaints. I tried inserting Application.ScreenUpdating = False but it didn't stop. Not sure I have it in right place. When I say slow I mean incredibly slow. I successfully tried similar code from within excel and it exported 50,000 records in 12 hours whereas this thing has run about 16 hours already and has yet to reach 15,000 records.

    The other thing is I can't stop it once it's running short of killing it with Task Manager. In fact I can't even get to the code window once it starts and doesn't respond to cursor clicks on anything. I can't even minimize the screen.

    This code has a MasterDocument that the user creates and within the VBA it creates another document or SingleDoc that it exports. Can't help but wonder if this also contributes to slowness but wouldn't know how to alter so just the MasterDoc updates are exports which would be more like my Excel script that just updates the design sheet and exports.

    Any suggestions as to how to improve efficiency and/or speed is appreciated.

    Please Login or Register  to view this content.
    Last edited by Hawk73ku; 05-14-2023 at 03:34 PM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Extremely slow VBA macro for mailmerge with Excel and can't control-break


    Add a DoEvents codeline just before Loop codeline in order you can 'break' just holding Esc key for example …

  3. #3
    Registered User
    Join Date
    02-09-2021
    Location
    21701
    MS-Off Ver
    365
    Posts
    3

    Re: Extremely slow VBA macro for mailmerge with Excel and can't control-break

    Thanks. I'll give it a go.

    Quick question: When you break, can you resume from the point you broke somehow?
    Last edited by Hawk73ku; 05-14-2023 at 03:39 PM. Reason: Add followup question to respondent.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Extremely slow VBA macro for mailmerge with Excel and can't control-break


    Yes as long as you stay in debug mode …

+ 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 extremely slow now
    By bittah.wanderer in forum Excel General
    Replies: 4
    Last Post: 08-31-2020, 11:33 PM
  2. [SOLVED] Excel suddenly extremely slow
    By duffynmu in forum Excel General
    Replies: 7
    Last Post: 11-28-2017, 11:54 AM
  3. Newbie here. Macro functions but extremely slow
    By nkagar2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-29-2014, 02:43 PM
  4. HELP! Extremely slow excel file
    By floripabay in forum Excel General
    Replies: 1
    Last Post: 06-29-2011, 06:07 AM
  5. Extremely slow macro!
    By PSm1th29 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2010, 06:27 AM
  6. Excel is extremely slow now
    By Martindelica in forum Excel General
    Replies: 0
    Last Post: 05-01-2007, 08:32 PM
  7. Excel vba script extremely slow
    By persenena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2005, 08:05 AM

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