Component request pending using word

J

Jim

Hi, there,
When I call word to create a file in VB, I got a
probelm message: "This action cannot be completed because
the other application is busy,choose 'switch to' to
activate the busy application to correct problem", actually
when I run the first time, no problem,but I run it again,
I got this message, though I use "Set moWordDoc =
Nothing " and "Set moWordApp = Nothing"
and "word.application.quit", but I still found a process
called "WINWORD" in the task manager,pls help me,thanks!!!

Source Code:

Dim moWordApp As Word.Application
Dim moWordDoc As Word.Document

Set moWordApp = New Word.Application
moWordApp.Visible = False
With moWordApp
Set moWordDoc = moWordApp.Documents.Add
With moWordDoc.Application.Selection
.InsertFile StandardClausePath + Clsfname
end with
moWordDoc.SaveAs Txt_PolicyClause.Text
moWordDoc.Close (False)
.Quit
End With

Set moWordDoc = Nothing
Set moWordApp = Nothing
word.application.quit
 
F

Francis Dion

Hi,

You might want to consider using XpertDoc rather than MS-Word to
create your documents from VB.

XpertDoc creates genuine MS-Word documents, it is much faster (it can
create hundreds of documents per seconds), much easier to implement
(requires typically one tenth of the lines of code you need for
Automation) and much more reliable.

You can download a free evaluation copy at www.xpertdoc.com

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top