Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2017, 08:10 AM
John_G John_G is offline Word 2013 is crashing when used with Access 2013 Windows 7 32bit Word 2013 is crashing when used with Access 2013 Office 2010 32bit
Novice
Word 2013 is crashing when used with Access 2013
 
Join Date: Jul 2012
Posts: 11
John_G is on a distinguished road
Default Word 2013 is crashing when used with Access 2013

This is a duplicate post of one I put on AccessForums.net.
It's a bit long, so please see the details here




http://www.accessforums.net/showthread.php?t=63954

Briefly, the problem is this. I have an MS Access application which in Office 2010 uses VBA to:
  1. Open an existing MS Word document to use as a template (it is a normal MS word document, though). The structure is a "header" area at the top ("header" only in the sense that it is not in a table), followed by a table of one or more rows. The table initially contains one row, which has a bookmark in column 1. I do it this way because the nature of the application is such that there will always be at least one row in the table.
  2. Navigates through the document header using existing bookmarks, adding information from the database
  3. adds document details to the table, adding the second and subsequent rows if required
  4. saves the completed document to a specified location with a file name derived from the file contents and date
  5. closes MS Word
In Access 2010 (and earlier), this works fine. The database user does not have to interact with MS Word at all.

However, in Office 2013 it fails at step 3. But it is not a normal failure - MS Word crashes with the message that it has encountered a problem and needs to close. It does not give any kind of run-time error.

I can isolate the line where the problem occurs in my VBA code (I think), but I can't fix it because I don't what's wrong. It worked fine before.

I am hoping that there is an MS Office technical guru in here who, if you don't know specifically what is wrong, can point me in the right direction to find a solution.

IMO, it is an installation or configuration problem, but who knows.

Thanks in advance!!
Reply With Quote
  #2  
Old 02-21-2017, 03:22 PM
macropod's Avatar
macropod macropod is offline Word 2013 is crashing when used with Access 2013 Windows 7 64bit Word 2013 is crashing when used with Access 2013 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,856
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Two possibilities immediately come to mind:
1. A faulty Office 2013 installation;
2. A corrupt Word document with a form of corruption Word 2013 is sensitive to.

For the first, you could try repairing the Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office 2013 > Change > Repair).

For the second, corrupt documents can often be 'repaired' by inserting a new, empty, paragraph at the very end, copying everything except that new paragraph to a new document based on the same template (headers & footers may need to be copied separately), closing the old document and saving the new one over it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-04-2017, 11:56 AM
John_G John_G is offline Word 2013 is crashing when used with Access 2013 Windows 7 32bit Word 2013 is crashing when used with Access 2013 Office 2010 32bit
Novice
Word 2013 is crashing when used with Access 2013
 
Join Date: Jul 2012
Posts: 11
John_G is on a distinguished road
Default MS Access VBA code causes MS Word 2013 to crash

Hi All -

This is a followup to a thread I posted earlier:
https://www.msofficeforums.com/offic...ss-2013-a.html

I still have not been able to solve this; I am convinced there is a problem with something our IT has done with an Office update (but try to tell them that). Thanks to all who offered assistance, but nothing worked.

Attached is a small database I use to demonstrate the problem. It is the simplest of the simple - no tables, forms, reports, queries or macros. Just one module with two versions of a procedure. The first works without a problem, the other crashes Word with no error message other than Word stopped. File names and locations are hard-coded, so the zipped folder has to be extracted as it is.

What I am hoping really is that it will NOT crash Word 2013 on other users' PC's, so that I will know that it really is our installation.

Thanks for any insight anyone can offer - I'd like to get this fixed.

Thanks
Attached Files
File Type: zip Access_Test.zip (42.1 KB, 9 views)
Reply With Quote
  #4  
Old 04-04-2017, 06:59 PM
macropod's Avatar
macropod macropod is offline Word 2013 is crashing when used with Access 2013 Windows 7 64bit Word 2013 is crashing when used with Access 2013 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,856
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I see no indication that either of the suggestions in my previous reply have been implemented.

As for the Access code in your sample DB, there's nothing inherently 'wrong' with it, though I note that what you're calling a template is actually a document - and that you're opening it as such. A Word template would have a .dotx extension and you'd create a new file from it via the .Documents.Add method.

Regarding the code you originally posted at AccessForums, I note you had a problem with this line:
Set wrdRange = wrdDoc.GoTo(What:=wdGoToBookmark, Name:="Item")
That could, of course, occur if the document lacked such a bookmark, besides with it would be more efficient to replace all of:
Code:
Set wrdRange = wrdDoc.GoTo(What:=wdGoToBookmark, Name:="Item")
    wrdRange.Select
    wrdRange.InsertAfter TranslationItem
with:
Code:
wrdDoc.Bookmarks("Item").Range.InsertAfter TranslationItem
and, as a safeguard against errors caused by missing bookmarks, you might use:
Code:
With wrdDoc
  If .Bookmarks.Exists("Item") Then .Bookmarks("Item").Range.InsertAfter TranslationItem
End with
PS: Kindly don't start new threads on the same topic. I've moved you latest post into the original thread.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-06-2017, 12:58 PM
John_G John_G is offline Word 2013 is crashing when used with Access 2013 Windows 7 32bit Word 2013 is crashing when used with Access 2013 Office 2010 32bit
Novice
Word 2013 is crashing when used with Access 2013
 
Join Date: Jul 2012
Posts: 11
John_G is on a distinguished road
Default

Sorry Paul - I should have answered sooner. For your suggestions - I can't try the Office repair one, because out IT group removed that functionality from the installation we see.

I tried fixing the Word document, that didn't work either. From what I can see from trial and error, there is an issue with the .GoTo method when it is called from MS Access. It simply doesn't work - it crashes Word without an error message, and it doesn't even get to checking to see if the bookmark is valid or not. Interestingly, it does not seem to work in Office 2016, either. I took it home to try, and while it doesn't crash Word, it cause Word to hang and become completely unresponsive.

I can't use this at this point:
Quote:
wrdDoc.Bookmarks("Item").Range.InsertAfter TranslationItem
because I do need to navigate to the bookmark, and move around after doing so. That code does work elsewhere, though.

After much searching, I did find a workaround that doesn't use the GoTo:

Code:
 
  wrdDoc.Bookmarks("Bookmark1").Range.Select
  Selection.InsertAfter "This is some text?"
and it seems to do the trick. Thanks for all your suggestions.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word/Outlook 2013 is crashing with ntdll.dll/MSVCR100.dll nomorehugs Office 1 01-25-2017 12:21 AM
Word 2013 is crashing when used with Access 2013 Word 2013 Macro Crashing Terminal Server Session exsquaddie Word VBA 1 02-18-2016 03:44 PM
Word 2013 is crashing when used with Access 2013 Office 2013 is crashing and renaming files when crashing Brewski Office 1 09-21-2015 09:04 PM
Outlook 2013 Crashing 5-10 seconds after opening armiller17 Outlook 0 11-18-2014 05:51 PM
Word 2013 is crashing when used with Access 2013 Excel 2013 crashing aki Excel 2 05-26-2014 01:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft