+ Reply to Thread
Results 1 to 3 of 3

Running a Word macro from Excel problem

  1. #1
    Registered User
    Join Date
    03-25-2004
    Posts
    54

    Running a Word macro from Excel problem

    I am trying to run a Word macro from Excel. The Macro, called DocumentSave1 is saved in the ThisDocument folder of the WrapUpTemplate file (see code). The relevant part of the code is:

    Dim wdApp as Word.Application

    Set wdApp = CreateObject("word.application")

    wdApp.Documents _
    .Open("P:\Spreadsheet Project\WrapUp\" & WrapUpTemplate) _
    .Application.Visible = True

    wdApp.Activate
    With wdApp

    ....various word coding to copy text into template (this all works fine)

    DocumentSave1

    End with

    I just don't know how to get it to go to the Word macro. I have tried moving DocumentSave1 to the Modules folder, but that does not seem to work either.

    Any help with this would be very gratefully received,

    Paul

  2. #2
    Martin
    Guest

    RE: Running a Word macro from Excel problem

    ..Run "DocumentSave1"

    "PaulC" wrote:

    >
    > I am trying to run a Word macro from Excel. The Macro, called
    > DocumentSave1 is saved in the ThisDocument folder of the WrapUpTemplate
    > file (see code). The relevant part of the code is:
    >
    > Dim wdApp as Word.Application
    >
    > Set wdApp = CreateObject("word.application")
    >
    > wdApp.Documents _
    > .Open("P:\Spreadsheet Project\WrapUp\" & WrapUpTemplate) _
    > .Application.Visible = True
    >
    > wdApp.Activate
    > With wdApp
    >
    > ....various word coding to copy text into template (this all works
    > fine)
    >
    > DocumentSave1
    >
    > End with
    >
    > I just don't know how to get it to go to the Word macro. I have tried
    > moving DocumentSave1 to the Modules folder, but that does not seem to
    > work either.
    >
    > Any help with this would be very gratefully received,
    >
    > Paul
    >
    >
    > --
    > PaulC
    > ------------------------------------------------------------------------
    > PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
    > View this thread: http://www.excelforum.com/showthread...hreadid=534989
    >
    >


  3. #3
    Registered User
    Join Date
    03-25-2004
    Posts
    54
    Martin

    Many thanks. I found it worked with just one period in front of Run:

    .Run "DocumentSave1"

    Thanks again,

    Paul

+ 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