Word 2019 crashes - wwlib.dll 0xc0000005 when a macro is trying to close the current document RRS feed

  • Question

  • We have a fairly complex form filling Word VBA script in a template so when a user double-clicks the template shortcut a new document is created that they fill in in a very prescribed manner and then when they click a button on the form two copies are saved, one to a secure folder and one (with the sensitive information removed) to a standard folder, the script then closes the document.  All has been working well until just recently but now almost every time the script closes the active document Word crashes.  The faulting error is as follows...

    Faulting application name: WINWORD.EXE, version: 16.0.12325.20298, time stamp: 0x5e169649
    Faulting module name: wwlib.dll, version: 16.0.12325.20296, time stamp: 0x5e16758a
    Exception code: 0xc0000005
    Fault offset: 0x00147308
    Faulting process ID: 0x2d50
    Faulting application start time: 0x01d5cc9380543848
    Faulting application path: C:\Program Files (x86)\Microsoft Office\Root\Office16\WINWORD.EXE
    Faulting module path: C:\Program Files (x86)\Microsoft Office\Root\Office16\wwlib.dll
    Report ID: dddf1edf-1fa7-4f60-a22e-379b0cfe1069
    Faulting package full name: 
    Faulting package-relative application ID: 

    The code defines the document handle as follows and closes it like this...

    Dim doc As Document
    Set doc = ActiveDocument

    (The code)
    doc.Close SaveChanges:=wdDoNotSaveChanges
    End Sub

    If I comment out the doc.Close command the let the user just press CTRL-F4 to close the document we don't get a crash!  No commands put in after the doc.Close command ever run if I put them in so that's the command that's causing the crash.

    I think the problem started when Word updated to 16.0.12325.20298 as part of the auto-update.  

    We have one required Word add-in that the script interacts with to also save the document to a document management system.  However this add-in isn't causing the problem as I've tried running the script with this disabled and also the whole add-in uninstalled and the same thing happens.

    All the PCs are running Windows 10 v1903 or 1909, and it happens on both.

    I've tried it on a PC without antivirus on (other than Defender) and it still happens on that too.

    Any ideas where to look?  To get the users to manually close the document isn't a huge deal but it's a bit shoddy.

    Phil Tyler

    Thursday, January 16, 2020 5:53 PM

All replies

  • Hi,

    Based on your description, I will move this thread to Word for Developer forum:

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    Emi Zhang

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Friday, January 17, 2020 8:28 AM