Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2016, 12:52 PM
littlepeaks littlepeaks is offline vba opened word files lock up sometimes Windows 7 64bit vba opened word files lock up sometimes Office 2010 32bit
Novice
vba opened word files lock up sometimes
 
Join Date: Jan 2012
Location: Colorado Springs, CO
Posts: 16
littlepeaks is on a distinguished road
Default vba opened word files lock up sometimes

I have a problem with Word documents opened from VBA from another Word document sometimes locking up, when you try to access and manipulate them directly (manually).

The documents are opened as follows:
Documents.Open FileName:=txtPath & "\document1.docx"
Documents.Open FileName:=txtPath & "\document2.doc"
Documents.Open FileName:=txtPath & "\document3.doc"
Documents.Open FileName:=txtPath & "\document4.docx"
Documents.Open FileName:=txtPath & "\document5.docx"

The "offending word files" lock up, especially if you click on the ribbon or the "x" in the upper right corner. It does not lock up other apps on the PC, but once one is locked up you can't go to any other Word documents that are open. The only way I can shut the locked-up document is through "Task Manager" --> end.

I was the one that posted on Jan 22 about bookmarks. I completed the project, and it works great -- VBA has no problems manipulating and printing the other open files. And they don't lock up when VBA is manipulating them. And I have it set, so when the macro document shuts down, it shuts down all the other documents without saving, programmatically. And that works well too.



I tried opening an instance of MS Word 2010, and opening all the files manually together with that instance and none of the files lock up when I do this and access them.

If it helps, some of the files that lock up -- it cuts off a little bit of the document's header, as if the document was scrolled down a little bit.

Hope someone can help -- this is just strange.
Reply With Quote
  #2  
Old 01-28-2016, 01:16 PM
littlepeaks littlepeaks is offline vba opened word files lock up sometimes Windows 7 64bit vba opened word files lock up sometimes Office 2010 32bit
Novice
vba opened word files lock up sometimes
 
Join Date: Jan 2012
Location: Colorado Springs, CO
Posts: 16
littlepeaks is on a distinguished road
Default

Never mind. I found what is causing the problem, and the solution -- this is just weird.

Before I ran the above snippit of code ran, I called "Application.ScreenUpdating = False".

After all the files were opened, I called "Application.ScreenUpdating = True".
I thought this would prevent the user from seeing the files opening (it doesn't -- you can still see the blank document outlines opening).

Well, I commented out the screenupdating code -- and voila -- everything works great, and the files no longer lock up.

Have a nice day --(My bad).
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
vba opened word files lock up sometimes list of Opened excel files SDondeti Word VBA 10 05-10-2018 03:52 PM
vba opened word files lock up sometimes Can you Lock part of a Word Doc? sareenasmith Word 4 05-13-2014 10:58 AM
XLM Files are not being opened in newer version of Microsoft Office 2013 KetulShah Excel 0 03-18-2014 08:23 PM
vba opened word files lock up sometimes How to download prev. opened Gmail files. libertyfelix Outlook 1 03-25-2012 09:10 PM
How Ms Word Lock memo85 Word 0 08-16-2009 07:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:54 AM.


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