Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way in Excel VBA to determine when a Word document has
been opened successfully? Or better yet, when the Word application will be free to open another document? In a loop in Excel VBA I open up Word documents one-by-one, the Word document automatically does some things (like update links and print), and meanwhile Excel checks to see if Word is done (results in a PDF file), then moves to the next document. After several documents are successfully processed, my VBA code in Excel fails on trying to open up the next Word document: Dim WordDoc as Word.Document . . . Set WordDoc = WordApp.Documents.Open(sWordDocPath & sWordName) and returns the error "Microsoft Office Excel is waiting for another application to complete an OLE action." Things get hung up from there, and I have to use TaskManager to kill the WinWord process. I tried throwing in some Sleep commands, to give things time to finish, but that did not seem to improve anything. I tried checking the value of WordDoc after the .Open statement, but it never reaches it. It gets hung on the .Open statement. I am not sure how to diagnose things from here. Thanks in advance for your help! Alan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel opens, but document doesn't | Setting up and Configuration of Excel | |||
Excel Document opens twice | Setting up and Configuration of Excel | |||
help creating a macro in excel that opens a specific word document | Excel Discussion (Misc queries) | |||
Determine if there's data in embedded word document | Excel Programming | |||
determine page number in Word document | Excel Programming |