Question : cross reference from Excel into Word

Is there a way of cross referencing to excel sheets from Word (both 2007 versions)?  I have numerous tables in sheets in Excel, and I want to refer to them (but do not want to hyperlink to them) dynamically, as I can do for cross referencing in Word itself  ie I need the number of the table to change (both in the Word text and the title in the Excel sheet) if I add in other tables.  Is there a way to do this ?  Thanks!  

Answer : cross reference from Excel into Word

This code to copy a caption to a linked workbook is as simple as I can make it.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Sub CopyCaption()
    Dim ilsh As Word.InlineShape
    Dim fld As Word.Field
    Dim xlApp As Excel.Application
    Dim xlWbk As Excel.Workbook
    Dim xlWks As Excel.Worksheet
    
    Set ilsh = ActiveDocument.InlineShapes(1)
    Set fld = ActiveDocument.Fields(2)
    
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    Set xlWbk = xlApp.Workbooks.Open(ilsh.LinkFormat.SourceFullName)
    Set xlWks = xlWbk.ActiveSheet
    xlWks.Cells(1, 1) = fld.Result
    xlWbk.Save
End Sub
Random Solutions  
 
programming4us programming4us