PDA

View Full Version : Inserting Table into Word From Excel VBA



jonn
04-25-2007, 10:13 AM
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

lucas
04-25-2007, 10:46 AM
Cross posted in Excel forum this site:
http://www.vbaexpress.com/forum/showthread.php?t=12513

Jonn,
you should at least tell them you have posted elswhere to keep folks from duplicating solutions that have already been posted. Please read this (http://www.excelguru.ca/node/7).

fumei
04-27-2007, 08:06 PM
I answered this in the Excel post. It is a syntax error. One underscore character is in the wrong place, and another should not be there at all.