Réponse acceptée !
Salut,
merci pour les remerciments

je te donne 2 methodes, a toi de voir, mais j'ai pas d'explication j'ai juste utilisé l'aide
Sub CreeTableau(NbLignes As Long, NbColonnes As Long)
Dim wd As Object, myRange As Object
Set wd = CreateObject("word.application")
With wd
.Documents.Add
.Visible = True
Set myRange = .ActiveDocument.Range(0, 0)
.ActiveDocument.Tables.Add Range:=myRange, NumRows:=NbLignes, NumColumns:=NbColonnes
End With
End Sub
Sub CreeTableau(NbLignes As Long, NbColonnes As Long)
Dim wd As Object, myTable As Object, myRange As Object
Set wd = CreateObject("word.application")
With wd
.Documents.Add
.Visible = True
Set myRange = .ActiveDocument.Range(0, 0)
Set myTable = .ActiveDocument.Tables.Add(Range:=myRange, NumRows:=NbLignes, NumColumns:=NbColonnes)
End With
End Sub
et j'aime toujours pas word

remarque : essai d'etre le plus generale possible c'est a dire de declare la variable wd en object et pas en Word.Application et aussi de ne pas utilisé de format predefinit specifique a word ou tout autre specificité. cela permetra a ton projet d'etre facilement exportable sans avoir a utilisé la reference microsoft word.
y a rien a faire j'aime pas word

et puis tien je vais etre gentil voici un bout de l'aide :
------------------------------------------------------------------------------------------------------------------
This example adds a blank table with three rows and four columns at the beginning of the active document.
Set myRange = ActiveDocument.Range(0, 0)
ActiveDocument.Tables.Add Range:=myRange, NumRows:=3, NumColumns:=4
This example adds a new, blank table with six rows and ten columns at the end of the active document
Set MyRange = ActiveDocument.Content
MyRange.Collapse Direction:=wdCollapseEnd
ActiveDocument.Tables.Add Range:=MyRange, NumRows:=6, _
NumColumns:=10
This example adds a table with three rows and five columns to a new document and then inserts data into each cell in the table.
Sub NewTable()
Dim docNew As Document
Dim tblNew As Table
Dim intX As Integer
Dim intY As Integer
Set docNew = Documents.Add
Set tblNew = docNew.Tables.Add(Selection.Range, 3, 5)
With tblNew
For intX = 1 To 3
For intY = 1 To 5
.Cell(intX, intY).Range.InsertAfter "Cell: R" & intX & ", C" & intY
Next intY
Next intX
.Columns.AutoFit
End With
End Sub
-----------------------------------------------------------------------------------------
non decidement word

ça passe pas

A+
