Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ExporterÉchantillon(string nomFichierExtrant, string[,] unÉchantillon)
- {
- var xlApp = new Excel.Application();
- var xlWorkBook = xlApp.Workbooks.Add();
- var xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.Item[1];
- xlWorkSheet.Name = "Échantillon";
- for (int ligne = 0; ligne < unÉchantillon.GetLength(0); ligne++)
- {
- for (int colonne = 0; colonne < unÉchantillon.GetLength(1); colonne++)
- {
- xlWorkSheet.Cells[ligne + 1, colonne + 1] = unÉchantillon[ligne, colonne];
- }
- }
- // Si la case d'ajouter la population est activée, on ajoute la population !
- AjouterPopulationSiNécéssaire(xlWorkBook);
- xlWorkBook.SaveAs(nomFichierExtrant);
- xlWorkBook.Close(true);
- xlApp.Quit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement