VBA - vytvoreni tabulky

From: ov <o.vahalik (zavinac)>
Date: 05. 05. 2005, 21:38 CEST
Ahoj.
V office2000 VBA mam nasledujici problem:

Pokud vytvorim tabulku ve wordu pomoci kodu

Sub tabulka_ ve_wordu()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=6, NumColumns:= _
        2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
        wdAutoFitFixed
    With Selection.Tables(1)
        .Columns.PreferredWidth = CentimetersToPoints(8.5)
        .Rows.Height = CentimetersToPoints(3.2)
    End With
End Sub
 atd. atd.
je vse funkcni,  tabulka se vytvori

Potrebuju ale vytvorit tuto tabulku v excelu a kdyz pouziji stejneho kodu,
skoncim u vytvoreni tabulky
_______________________________________
Public wd As Word.Application
Sub tabulka_z_excelu()
    Set wd = CreateObject("word.application.9")
        otevrit
    Set wd = Nothing
End Sub
_____________________________

Sub otevrit()

    With wd
        .Documents.Add Template:="Normal", NewTemplate:=False,
DocumentType:=0                ' OK
        .Visible = True
' OK
        .ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=6,
NumColumns:= _
        2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=
wdAutoFitFixed          '  ***

        With Selection.Tables(1)
            .Columns.PreferredWidth = CentimetersToPoints(8.5)
            .Rows.Height = CentimetersToPoints(3.2)
        End With
   End With

End Sub
______________________________

*** Tady mi vyskoci chybove hlaseni:
" Wrong number of arguments or invalid property assignment"

Netusite nekdo, proc?

Diky.
OV
Received on Thu, 5 May 2005 21:38:02 +0200

This archive was generated by hypermail 2.1.8 : 05. 05. 2005, 21:38 CEST