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
|
if not Rs.EOF then
chemin= "Recap.XLS"
Set fso = CreateObject("Scripting.FileSystemObject")
Set Fic = fso.CreateTextFile(chemin, True)
' Titres des colonnes
' chr (34) remplace les guillements à la suite de l'instruction
Fic.writeLine "ID;PWXL;N;E" ' Début du codage excel
Fic.writeLine "C;Y1;X1;K" & CHR(34) & ("Nom") & CHR(34)
Fic.writeLine "C;Y1;X2;K" & CHR(34) & ("Prenom") & CHR(34)
Rs.movefirst
Ligne = 2
do while not Rs.eof
Str_Nom = Rs(0)
Str_Prenom = Rs(1)
Fic.writeLine "C;Y" & Ligne & ";X1;K" & CHR(34) & (Str_Nom) & CHR(34)
Fic.writeLine "C;Y" & Ligne & ";X2;K" & (Str_Prenom)
Ligne = Ligne + 1
Rs.MoveNext
loop
Fic.writeLine "E" ' Fin du codage excel
Fic.Close
Set Fic = Nothing
Set fso = Nothing
end if |
Partager