Salut, je n'arrive pas à trouver la solution sur le web pour mon problème. J'utilise Visual Basic 6 et je fais imprimer des formulaires dans excel 2003. Je peux facilement éditer les cellules du formulaire, mais je ne parvient pas à coché ou décocher les controles de cases à coché de la feuille à partir du code.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Public Function ImprimerLoaner()
    Dim debugApp As String
    debugApp = False
    Set DevisExcel = CreateObject("Excel.Application")
    If debugApp = True Then
        DevisExcel.Visible = True
    Else
        DevisExcel.Visible = False
    End If
    DevisExcel.Workbooks.Open FileName:=App.Path + "\Loaner.xls"
    DevisExcel.DisplayAlerts = False
    Select Case frmImprimerWO.cmbLangue.Text
        Case "Francais"
            DevisExcel.Sheets("FR").Select
            DevisExcel.Range("A4") = "AGENT :" + frmWO.txtPrenom.Text + " " + frmWO.txtNom.Text + " / " + frmWO.txtCodeAgent.Text
        Case "Anglais"
            DevisExcel.Sheets("EN").Select
            DevisExcel.Range("A4") = "NAME :" + frmWO.txtPrenom.Text + " " + frmWO.txtNom.Text + " / " + frmWO.txtCodeAgent.Text
        Case Else
            MsgBox "Langue d'impression non valide l'impression de la lettre d'attribution est annuler", vbOKOnly, "Attribution"
            Exit Function
    End Select
    DevisExcel.Range("B6") = frmWO.cmbModele.Text
    DevisExcel.Range("A8") = "DATE :" + CStr(FormatDateTime(Date$, vbShortDate))
    DevisExcel.Range("F4") = frmWO.txtDistrict.Text + "-" + frmWO.txtUS.Text
    DevisExcel.Range("F6") = frmWO.txtSerial.Text
    If (frmWO.chkAdapt.Value) = 1 Then DevisExcel.chkAdapt.Value = True
    If debugApp = False Then
        If IsNumeric(frmImprimerWO.txtCopie.Text) = True Then
            DevisExcel.ActiveSheet.PrintOut , , CInt(frmImprimerWO.txtCopie.Text)
        Else
            DevisExcel.ActiveSheet.PrintOut , , 1
        End If
        DevisExcel.Application.Quit
    End If
End Function
Quelqu'un a une solution?