Using word during macro.

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hello,

I am using this script:

****************************************************************************
....copy data to clipboard from external program then

Set oWRDapp = CreateObject("WORD.Application")
Set oWRDdoc = oWRDapp.Documents
oWRDdoc.Add DocumentType:=0
oWRDapp.Selection.Paste
oWRDapp.Selection.TypeParagraph

....again copy data to clipboard from external program then save

oWRDapp.ActiveDocument.SaveAs Filename:=part_path & "\" & SaveNAME, _
FileFormat:=wdFormatText, LockComments:=False, Password:="",
AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False,
SaveAsAOCELetter:=False, _
Encoding:=1252, InsertLineBreaks:=False,
AllowSubstitutions:=False, LineEnding:=wdCRLF
oWRDapp.Quit
Set oWRDapp = Nothing
****************************************************************************

And this hole procedure I used many times during one macro, when macro finis
there left many word.exe processes in memory.
How can I correct this problem.
 
Hi

Try

Set oWRDapp = CreateObject("WORD.Application")
oWRDapp.Visible = True

and see what happens. My guess is that each instance ask you something (like
"save changes ?") that you're not responding to. Which you shouldn't, your
code should prevent it from happening. But find out what it is first.

HTH. best wishes Harald
 

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

Back
Top