Hi,
How would i do this i've tried this but it displays a 'Wrong Number of arguments error'
Code:
.ActiveDocument.Tables.Add NumRows:=2, NumColumns:= _ 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed
Thanks
Hi,
How would i do this i've tried this but it displays a 'Wrong Number of arguments error'
Code:
.ActiveDocument.Tables.Add NumRows:=2, NumColumns:= _ 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed
Thanks
Hi jonn,
You might try looking in word vba on how to create your table and then try it from excel. An example from the word help file:
[VBA]Selection.Collapse Direction:=wdCollapseStart
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
NumRows:=5, NumColumns:=5)
myTable.AutoFormat Format:=wdTableFormatClassic2[/VBA]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
This is a simple syntax error. Look closely.
.ActiveDocument.Tables.Add NumRows:=2, NumColumns:= _ 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed
[vba].ActiveDocument.Tables.Add NumRows:=2, NumColumns:=2, _
DefaultTableBehavior:=wdWord9TableBehavior, _
AutoFitBehavior:=wdAutoFitFixed[/vba]Your underscore characters are in the wrong place. The one before wdAutoFitFixed should not be there at all.