Paste in WinWord, problems with several processes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When using the following code, winword remain as an process in task-manager.
That become a problem when I run the macro again and again. I had hundereds
of processes running.
_____________________________________
Dim wdbasic As Object
Set wdbasic = CreateObject("word.basic")
With wdbasic
.FileOpen "I:\PROTOKOL\" & yyyy & "\" & inv$ & b$ & "." & yy & iLOOP
& ".doc"
.EditPaste
.FileSave
.fileclose
End With
Set wdbasic = Nothing
______________________________________
any clue ?
 
Why are you using
CreateObject("word.basic")
instead of
CreateObject("Word.Application")???

For that matter, if you are going to open and work with a specific Word doc,
then why not something like:

Dim WD As Object
Dim doc As Object
Dim dName As String
Set WD = CreateObject("Word.Application")
dName = "I:\PROTOKOL\" & yyyy & "\" & inv$ & b$ & "." & yy & iLOOP & ".doc"
Set doc = WD.Documents.Add dName
With doc
.EditPaste
.FileSave
.fileclose
End With

WD.Quit
Set doc = Nothing
Set WD = Nothing

(Note: pieced together from previous macros; not tested like this)
Ed
 
Hi Lasse,
When using the following code, winword remain as an process in task-manager.
That become a problem when I run the macro again and again. I had hundereds
of processes running.
any clue ?
.


Well, I know that the same is happening when opening and
closing Outlook... maybe its a whole Office task that
closed programs are not unloaded from the task manager...

This is no solution for your problem, I know, but I just
want to give "my two cents" ;o)

Best

Markus
 

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