Bonjour,

je me sers d'un document Excel pour imprimer des informations, j'arrive à creer un doc Excel, à le remplir comme je le voudrais, mais je n'arrive pas à changer la police ou à mettre une cellule en gras par exemple.

Voici mon 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
 
            XLAppImprimer = CType(CreateObject("Excel.Application"), Excel.Application)
            XLAppImprimer.Application.Visible = True
            XLBookImprimer = CType(XLAppImprimer.Workbooks.Add(), Excel.Workbook)
 
         For i = 1 To CollectionLigne.Count
              Dim j As Integer = 3
              Dim pile As New UIInSitePileWRCFixe(CollectionLigne(i))
              pile.Mapper.RequestField("ListeContainers")
              pile.Load(partial:=True)
 
              XLSheetImprimer = CType(XLBookImprimer.Worksheets("Sheet1"), Excel.Worksheet)
              XLSheetImprimer.Cells(1, 1) = XLSheetImprimer.Cells.Font.Bold
              XLSheetImprimer.Cells(1, 1) = pile.ShortName
 
              For Each produit In pile.ListeContainers
                XLSheetImprimer.Cells(j, 1) = "'" + produit.Name + "'"
                j = j + 1
              Next
 
              XLSheetImprimer.PrintPreview()
            Next
Quelqu'un peut-il me dire pourquoi la ligne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
XLSheetImprimer.Cells(1, 1) = XLSheetImprimer.Cells.Font.Bold
ne fonctionne pas, et qu'elle est la manière de formatter des cellules sous Excel?

merci