1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
Option Explicit
Const N =3
Dim Tableau(6, N) As String
Dim NombreDeLignes As Integer
Dim LigneCourante As Integer
Private Sub Form_Load()
Dim Fichier As String
Dim Ligne As String
Dim I As Integer
[color=red] ' Apparement ça serait par ici mais je ne sais pas quoi.[/color]
LigneCourante = 1
CommonDialog1.Filter = "Texte (*.txt)|*.txt|Tous (*.*)|*.*"
CommonDialog1.ShowOpen
Fichier = CommonDialog1.FileName
On Error Resume Next
Open Fichier For Input As #1
NombreDeLignes = 0
Do Until EOF(1)
Line Input #1, Ligne
Text1.Add Ligne
NombreDeLignes = NombreDeLignes + 1
Loop
Close #1
Open Fichier For Input As #1
For I = 1 To NombreDeLignes
Input #1, Tableau(1, I), Tableau(2, I)
Next I
Close #1
For I = 1 To 2
Boite(I - 1).Text1 = Tableau(I, 1)
Next I
End Sub
[color=red] ' Cette partie apparemment fonctionne ici j'ouvre un fichier excel ou j'ai regroupé toute les données et fait des calculs enregistré dans des macros j'aurai voulu compliqué en remettant les calcul dans VB mais bon je sais pas faire non plus.[/color]
Private Sub btnlancerexcel_Click()
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Open ("H:\MesprojetsVB\Programme vb\enqu--te client(1).xls")
End Sub
Private Sub btnquitexcel_Click()
If CallExcel Then
xlWorkBook.Close False
xlApp.Quit
Set xlSheet = Nothing
Set xlWorkBook = Nothing
Set xlApp = Nothing
End If
End
End Sub
Const N = 3
Dim Tableau(6, N) As String
Je vous remercie d'avance je dois rendre mon programme lundi soir et j'aimerai faire en sorte qu'il fonctionne. Désolé d'être un boulet en informatique mais cette note est capital pour mes examens.
Merci |
Partager