Sub genepageexercises() 'nbsentences = Worksheets("PerStudent").Cells(Rows.Count, 1).End(xlUp).Row - 2 nbetudiants = Worksheets("Students").Cells(Rows.Count, 1).End(xlUp).Row - 1 ' - en-tête If nbetudiants = 0 Then MsgBox ("Aucun membres dans le groupe. Vérifiez la feuille Students") GoTo ErrorHandler End If package = ThisWorkbook.Worksheets("PerStudent").Cells(1, 1).Value ' Application.ScreenUpdating = False 'evite le clignotement des feuilles 'création du fichier html 'destruction préalable s'il existe '--------- textfile = ThisWorkbook.Path & "\doc-evaluation\" & "Written-evaluation.html" If Dir(textfile) <> "" Then annonce = "régénérer" Kill textfile Else annonce = "créer" End If Close #1 ' sécu si ouvert '----------- Open textfile For Append Shared As #1 Print #1, Worksheets("htmexercises").Cells(1, 1).Value & package & ThisWorkbook.Worksheets("htmexercises").Cells(2, 1).Value ' For j = 3 To ThisWorkbook.Worksheets("PerStudent").Cells(2, Columns.Count).End(xlToLeft).Column ' recopies de la colonnes des phrases Print #1, ThisWorkbook.Worksheets("htmexercises").Cells(3, 1).Value & Worksheets("PerStudent").Cells(2, j).Comment.Text & ThisWorkbook.Worksheets("htmexercises").Cells(4, 1).Value 'changement de ligne 'saut de section Next j '------------------------------------------------------------- 'fin de page html Print #1, ThisWorkbook.Worksheets("htmexercises").Cells(5, 1).Value Close #1 '--------- '----------- Page = ThisWorkbook.Path & "\doc-evaluation" & slash & "Written-evaluation.html" Call OuverturePage(Page) 'Call genepagereleves ErrorHandler: End Sub