B
Betina Y Andersen
I have a VB6 app that uses vba against Word 2000.
When I runs the line Set WordObj = Nothing it takes from 1 minut up to 10
minutes to get freed from memory.
This problem has come as I have added some code to one of my procedures, I
have added the following
FilNavn = Mid(CStr(VisWord), 7, Len(CStr(VisWord)) - 6)
WordObj.Selection.WholeStory
WordObj.Selection.Copy
WordObj.Documents.Add
WordObj.Selection.Paste
WordObj.ActiveDocument.SaveAs FileName:=FilNavn
WordObj.ActiveDocument.Close
WordObj.Selection.HomeKey
Then I return to VB and does some code before calling another procedure
that
end Word:
WordObj.ActiveDocument.PrintOut Background:=False
WordObj.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WordObj.Quit
Set WordObj = Nothing
It is the last line that takes up all my CPU and uses from 1 munute and up
to complete.
What can I do to speed this up, cos it is unbearable to sit and wait for it
to complete and I use this a lot in my VB app?
Regards Betina
When I runs the line Set WordObj = Nothing it takes from 1 minut up to 10
minutes to get freed from memory.
This problem has come as I have added some code to one of my procedures, I
have added the following
FilNavn = Mid(CStr(VisWord), 7, Len(CStr(VisWord)) - 6)
WordObj.Selection.WholeStory
WordObj.Selection.Copy
WordObj.Documents.Add
WordObj.Selection.Paste
WordObj.ActiveDocument.SaveAs FileName:=FilNavn
WordObj.ActiveDocument.Close
WordObj.Selection.HomeKey
Then I return to VB and does some code before calling another procedure
that
end Word:
WordObj.ActiveDocument.PrintOut Background:=False
WordObj.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WordObj.Quit
Set WordObj = Nothing
It is the last line that takes up all my CPU and uses from 1 munute and up
to complete.
What can I do to speed this up, cos it is unbearable to sit and wait for it
to complete and I use this a lot in my VB app?
Regards Betina