Hi,
Just the principle:
Sub Test444()
'reference to word library
Dim oWrd As Word.Application
Dim oDoc As Word.Document
Set oWrd = CreateObject("word.application")
Set oDoc = oWrd.Documents.Open("c:\test\testdoc.doc")
' oWrd.Visible = False
oDoc.Tables(2).Cell(3, 3).Range.Text = _
ActiveWorkbook.Worksheets(1).Cells(3, 3).Value
oDoc.Save
oDoc.Close
Set oDoc = Nothing
oWrd.Quit
Set oWrd = Nothing
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Helmut Weber - 29 Apr 2005 21:20 GMT
Oops,
the example started from Excel.
For a start from Word it would be,
if there is no instance of Excel already active.
Sub Test444()
'reference to Excel library required
Dim oExc As Excel.Application
Dim oWrk As Excel.Workbook
Set oExc = CreateObject("Excel.application")
Set oWrk = oExc.Workbooks.Open("c:\test\Excelfile.xls")
' oWrd.Visible = False
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = _
oWrk.Worksheets(1).Cells(1, 1).Value
oWrk.Close
Set oWrk = Nothing
oExc.Quit
Set oExc = Nothing
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/