Re: VBA - vytvoreni tabulky

From: AleX <faklabrejle (zavinac)>
Date: 06. 05. 2005, 09:08 CEST
po zbeznom zhliadnuti sa mi zda ze ti chyba jedna bodka:
tvoje: 
With Selection.Tables(1)
spravne
With .Selection.Tables(1)


On 5/5/05, ov <o.vahalik@atlas.cz> wrote:
> 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
> 
> ===================================================== reklama =====
> Prenosny DVD prehravac TOSHIBA
> Pro milovniky mobilni zabavy! Podpora DivX, MP3, LCD 17,5 cm.
> 8 909 Kc bez DPH | http://computer.cz/DetailPage.asp?DPG=51705
> ===================================================================
> 
> --
> -- Konference: SERVIS ------ Pravidla: http://pravidla.kab.cz/ --
> -- Archiv, instrukce pro odhlaseni: http://internet.nawebu.cz/ --
> -- Konference Internet Info, s.r.o. ----- http://www.iinfo.cz/ --
> 
> 


-- 
AleX
Received on Fri, 6 May 2005 09:08:38 +0200

This archive was generated by hypermail 2.1.8 : 06. 05. 2005, 09:08 CEST