Word to Excel???
Word to Excel???
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Word to Excel???

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Los Angeles, CA
    Posts
    752
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have a macro in Word that formats a report. I also have another macro in excel that finishes the formatting and adds some formulas and totals up the numbers.

    Is there a way to automatically have the excel macro run, once the word macro is finished?

    Thanks

  2. #2
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi. Please try this.

    'Assumption
    Word File is Open.
    Excel File is Not Open.
    The Excel file is in a current folder.


    '--Word standard module-------------------------
    Sub Word_Proc()
    Dim XlApp as object
    Set XlApp = CreateObject("Excel.Application")
    'Whatever
    MsgBox "... done", , "Word_Proc"
    With XlApp
    .Visible = True
    .workbooks.Open ("Book1.xls")
    .Application.Run "XL_Proc"
    End With
    Set XlApp = Nothing
    End Sub
    '-------------------------------------------------

    '--Excel standard module--------------------------
    Sub XL_Proc()
    'Whatever
    MsgBox "...done", , "XL_Proc"
    End Sub
    '-------------------------------------------------

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com