Csharp et Excel
Kdior
-
tresorunikin Messages postés 27 Statut Membre -
tresorunikin Messages postés 27 Statut Membre -
Bonjour,
Je suis débutant en Csharp, j'ai crée une application Csharp qui génère un fichier Excel.
je souhaiterai utiliser la fonction Rechercher et Remplacer d'Excel via Csharp .
J'ai chercher sur le web mais je ne trouve vraiment rien .
je ne sais pas si c'est possible ?
Voici un bout de mon code :
Microsoft.Office.Interop.Excel.Application oXL;
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;
Microsoft.Office.Interop.Excel.Range oRng;
object M = System.Reflection.Missing.Value;
private void button1_Click_1(object sender, EventArgs e)
{
try
{
//Start Excel and get Application object.
oXL = new Microsoft.Office.Interop.Excel.Application();
oXL.Visible = true;
//Get a new workbook.
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value));
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;
// Microsoft.Office.Interop.Excel.s
//Add table headers going cell by cell.
oSheet.Cells[1, 1] = "First Name";
oSheet.Cells[1, 2] = "Last Name";
oSheet.Cells[1, 3] = "Full Name";
}
}
Je suis débutant en Csharp, j'ai crée une application Csharp qui génère un fichier Excel.
je souhaiterai utiliser la fonction Rechercher et Remplacer d'Excel via Csharp .
J'ai chercher sur le web mais je ne trouve vraiment rien .
je ne sais pas si c'est possible ?
Voici un bout de mon code :
Microsoft.Office.Interop.Excel.Application oXL;
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;
Microsoft.Office.Interop.Excel.Range oRng;
object M = System.Reflection.Missing.Value;
private void button1_Click_1(object sender, EventArgs e)
{
try
{
//Start Excel and get Application object.
oXL = new Microsoft.Office.Interop.Excel.Application();
oXL.Visible = true;
//Get a new workbook.
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value));
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;
// Microsoft.Office.Interop.Excel.s
//Add table headers going cell by cell.
oSheet.Cells[1, 1] = "First Name";
oSheet.Cells[1, 2] = "Last Name";
oSheet.Cells[1, 3] = "Full Name";
}
}
A voir également:
- Csharp et Excel
- Word et excel gratuit - Guide
- Liste déroulante excel - Guide
- Si et ou excel - Guide
- Déplacer colonne excel - Guide
- Comment trier par ordre alphabétique sur excel - Guide
si non tu peux te créer toi même une fonction de recherche en plaçant des cellules dans une List<cell> et je pense qu'il te sera utile de connaitre l'interface ICompable ...
Disons que, personnellement je fais pas d'applications pour Office...