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
"lasse g" <lasse
wrote in message
...
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 ?