+ Reply to Thread
Results 1 to 3 of 3

Paste in WinWord, problems with several processes

  1. #1
    lasse g
    Guest

    Paste in WinWord, problems with several processes

    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 ?

  2. #2
    Ed
    Guest

    Re: Paste in WinWord, problems with several processes

    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 [email protected]> wrote in message
    news:[email protected]...
    > 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 ?




  3. #3
    Markus Scheible
    Guest

    Paste in WinWord, problems with several processes

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1