Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA - Insert Word Table problem
I am trying to add a word table into a word document that opens from a
Excel97 macro. Everything works fine until I try to insert the table The code is: Set wdApp = CreateObject("word.application") wdApp.Documents.Open("C:Attendance _ Note.doc").Application.Visible True With wdApp .Visible = True With .Selection .TypeText Text:="Attendance Note" .TypeParagraph .Tables.Add Range:=Selection.Range,NumRows:=6, NumColumns:=4 End With End With This works except it will not insert the table. What have I misse out? Pau -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA - Insert Word Table problem
Selection does not have a Tables property try
Set wdApp = CreateObject("word.application" wdApp.Documents.Open("C:Attendance _ Note.doc").Application.Visible = Tru With wdAp ..Visible = Tru With .Selectio ..TypeText Text:="Attendance Note ..TypeParagrap wdApp.documents(1).Tables.Add Range:=.Range, NumRows:=6, NumColumns:= End Wit End Wit ----- PaulC wrote: ---- I am trying to add a word table into a word document that opens from a Excel97 macro. Everything works fine until I try to insert the table The code is Set wdApp = CreateObject("word.application" wdApp.Documents.Open("C:Attendance _ Note.doc").Application.Visible Tru With wdAp .Visible = Tru With .Selectio .TypeText Text:="Attendance Note .TypeParagrap .Tables.Add Range:=Selection.Range,NumRows:=6, NumColumns:= End Wit End Wit This works except it will not insert the table. What have I misse out Pau -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert word to excel | Excel Discussion (Misc queries) | |||
Insert Word Document into Excel | Excel Discussion (Misc queries) | |||
PROBLEM WITH EXCEL TABLE IN WORD | Excel Discussion (Misc queries) | |||
Link table from excel to word using word VBA | Excel Discussion (Misc queries) | |||
Problem with linked Excel table in a word Document | Excel Discussion (Misc queries) |