Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default writing to a table in wrod from excel

I recorded the following macro in word
Sub Macaddtable()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=6,
NumColumns:= _
4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitWindow
With Selection.Tables(1)
If .Style < "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With
Selection.TypeText Text:="Qty"
Selection.MoveRight Unit:=wdCharacter, Count:=1

End Sub
I put it in excel and it errors on
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=6, NumColumns:= _
4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitWindow
saying not the right numbe of arguments.
I have references to word 11.0 .

Any help please?
--
Jason V
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasrte defaults to wrod wrap. Howto Cahnge Phil Smith Excel Discussion (Misc queries) 0 August 29th 07 12:31 AM
How to use VBA read entries from a Wrod file into Excel Robin Excel Programming 3 November 30th 05 01:30 AM
retain table formatting when writing excel table to a txt file deanop Excel Programming 8 September 3rd 05 05:38 AM
how do I create Business Cards with Office Wrod 2003? S_Marble Excel Discussion (Misc queries) 1 February 1st 05 05:35 AM
Programmatically detect wrod-wrap? J S Excel Programming 0 September 11th 03 08:45 PM


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"