#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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). |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
list of Opened excel files | SDondeti | Word VBA | 10 | 05-10-2018 03:52 PM |
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 |
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 |