convertir une cellule d une fichier excel en String
Bonjour,
je veux afficher le contenu d une cellule d un fichier excel dans ma console mais j arrive pas, voila mon code, j ai besoin de convertir les cellule en String, comment faire??
voila mon code
Code:
1 2 3 4 5 6 7 8 9 10 11
|
String patch = "C:\\data\\passeWord.xls";
Object M=System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application xlsApplication;
Microsoft.Office.Interop.Excel.Workbook xlsWorkbook;
Microsoft.Office.Interop.Excel.Worksheet xlsWorksheet;
xlsApplication = new Microsoft.Office.Interop.Excel.Application();
xlsWorkbook = xlsApplication.Workbooks.Open(patch, M, M, M, M, M, M, M, M, M, M, M, M, M, M);
xlsWorksheet = (Worksheet)xlsWorkbook.ActiveSheet;
String xlsPW = xlsWorksheet.Cells[1, 1];
Console.WriteLine(xlsPW); |