+ Reply to Thread
Results 1 to 2 of 2

Excel to Word and back again

  1. #1
    Rominall
    Guest

    Excel to Word and back again

    I have the following code.
    Range("A7:N7").Select
    Selection.Copy
    Dim appWD As Word.Application
    Dim odoc As Word.Document
    Set appWD = CreateObject("Word.Application")
    appWD.Visible = True
    Set odoc = appWD.Documents.Add
    odoc.Range.PasteExcelTable False, False, False
    Set appWD = Nothing

    And it works but I want to copy multiple ranges, I can set up the loop
    required but how do I switch back and forth between the applications. When I
    try Application.ActivateMicrosoftApp xlMicrosoftExcel it brings up the
    calculator????



  2. #2
    Ed
    Guest

    Re: Excel to Word and back again

    You should have an object set to your Excel Workbook.
    objYourXLWKbObject.Activate should be what you need.
    Ed

    "Rominall" <[email protected]> wrote in message
    news:[email protected]...
    > I have the following code.
    > Range("A7:N7").Select
    > Selection.Copy
    > Dim appWD As Word.Application
    > Dim odoc As Word.Document
    > Set appWD = CreateObject("Word.Application")
    > appWD.Visible = True
    > Set odoc = appWD.Documents.Add
    > odoc.Range.PasteExcelTable False, False, False
    > Set appWD = Nothing
    >
    > And it works but I want to copy multiple ranges, I can set up the loop
    > required but how do I switch back and forth between the applications.

    When I
    > try Application.ActivateMicrosoftApp xlMicrosoftExcel it brings up the
    > calculator????
    >
    >




+ 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