spootnic22
Messages postés84Date d'inscriptionmardi 31 octobre 2006StatutMembreDernière intervention30 janvier 2010
-
24 avril 2007 à 20:20
spootnic22
Messages postés84Date d'inscriptionmardi 31 octobre 2006StatutMembreDernière intervention30 janvier 2010
-
24 avril 2007 à 20:54
salut,
pourriez vous me dire comment je peut programmer un tableau sous excel avec vb6?
pour être claire ,je veux programer 2 tableaux (1 est au dessous de l'autre) dans un même sheet avec le vb6 dans excel, ces tableaux contient 5 colonne chacun et 9 ligne
donc pourriez vous m'aider s'il vous plaît?
Merci
mortalino
Messages postés6786Date d'inscriptionvendredi 16 décembre 2005StatutMembreDernière intervention21 décembre 201118 24 avril 2007 à 20:31
Salut,
ce sont les mêmes codes que VBA Excel, sauf que tu dois référencer l'application Excel ainsi que le classeur.
Il faut ajouter la référence Microsoft Excel Object Library, puis
Dim xl As New Excel.Application
Dim wb As WorkBook
xl.Visible = True
Set wb = xl.WorkBook.Add
wb.Sheets(1).Range("TaPlage").Select
With wb.Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With wb.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With wb.Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With wb.Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With wb.Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With wb.Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With