Hi,
Thanx 4 reply bt I solved my problem with out downloading anything.But my soln can read excel sheet using query.
The code goes this way:-
CODE
using System;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;
//using Microsoft Office Excel 2003 11.0;
//using Excel;
namespace Excelcalling1
{
class Program
{
static void Main(string[] args)
{
string F1Name = "E:\\SheetForTest.xls";
string CnStr = ("Provider=Microsoft.Jet.OLEDB.4.0;" + ("Data Source="
+ ( F1Name + (";" + "Extended Properties=\"Excel 8.0;\""))));
DataTable DT = new DataTable();
OleDbDataAdapter DA = new OleDbDataAdapter("Select * from [Sheet1$]", CnStr);
Console.WriteLine("File Accessed!!!!");
try
{
DA.Fill(DT);
//dataGridView1.DataSource = DT;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
Note:You need to to do settings in Project>Add reference>Microsoft oject 11.0 library & Microsoft Excel 11.0 for this code to work.
I am not knowing how to find/query for a particular string in the excel sheet.
My aim is to select a part of excel(vertically) b/w two specific strings n read selected part.
Please reply in simple terms as I am new to programming
Any soln from scratch will also do or an extension to what I have already done