Voici ce qu'il y avait dans le code
- Code : Tout sélectionner
Print |Content-Type: application/vnd.ms-excel|
Print |Content-disposition: attachment; filename=| & strNomFichier
' On génère un tableau html, Excel le convertit automatiquement en cellule
strLine = |<table>| & strCRLF & strCRLF
Print strLine
'Récupération de l'entête de la vue
vColumn = vueToExport.Columns
strLine = |<tr>| & strCRLF & strCRLF ' Début de ligne
For lngCompteur=0 To Ubound (vColumn)
strLine = strLine & |<th>| & vColumn(lngCompteur).Title & |</th>| & strCRLF ' Entête
Next
strLine = strLine & |</tr>| & strCRLF & strCRLF ' Fin de ligne
Print strLine
'Récupération des données de la vue
Set vueNavigator= vueToExport.CreateViewNav()
Set vueEntry=vueNavigator.GetFirstDocument
While Not (vueEntry Is Nothing)
strLine = |<tr>| & strCRLF & strCRLF ' Début de ligne
For lngCompteur=0 To Ubound (vColumn)
strLine = strLine & |<td>| & vueEntry.ColumnValues(lngCompteur) & |</td>| & strCRLF ' Cellule
Next
strLine = strLine & |</tr>| & strCRLF & strCRLF ' Fin de ligne
Print strLine
Set vueEntry = vueNavigator.GetNextDocument(vueEntry)
Wend
' Fin du tableau html
strLine = |</table>|
Print strLine