Thread: [Solved] Applicatin.wait
View Single Post
 
Old 05-26-2011, 09:23 AM
SDondeti SDondeti is offline Windows XP Office 2007
Novice
 
Join Date: Apr 2011
Posts: 7
SDondeti is on a distinguished road
Default Applicatin.wait

Hi,

I am working in a word template 2007 in which i have to open other word file using vba and copy the data from that to template.
I am facing the problem error message, because of word file has got lot of pages to open and by the time it opens copy command is executed and throughing the error message.

I did worked in excel to keep application.wait()

Can any of you help me how to keep code execution wait till word file is open?

here is my sample code i used:
Documents.Open FileName:=txt_FileName.text
Windows(txt_FileName.text).Activate
UsereCoverRemove
Selection.WholeStory
Selection.Copy
Windows(sActiveDoc).Activate

Thank you..

SDondeti
Reply With Quote