Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to retrieve the the active worksheet of an Excel file using
OleDbConnection. With the following code, I can retrieve the list worksheets, but I can't find a way to get to the active one. string sExcelFileName = @"c:\excelfiles\ExcelFile.xls"; string sConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sExcelFileName + ";Extended Properties=\"Excel 8.0;HDR=No;IMEX=1;\""; OleDbConnection ExcelConnection = new OleDbConnection(sConnectionString); ExcelConnection.Open(); DataTable excelDataTable = ExcelConnection.GetOleDbSchemaTable(OleDbSchemaGui d.Tables, new object[] {null, null}); foreach (DataRow row in excelDataTable.Rows) { string sWorksheetName = row["TABLE_NAME"].ToString(); MessageBox.Show(sWorksheetName); } ExcelConnection.Close(); More generally, I need to access the content of the active worksheet of an excel file submitted to an ASP .NET web application. Any way of doing it without using directly server-side automation of Office? Thanks -- leob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I retrieve data from zip file into excel? | Excel Discussion (Misc queries) | |||
How can I retrieve a deleted excel file? | Excel Discussion (Misc queries) | |||
how do i retrieve a deleted Excel file | Excel Discussion (Misc queries) | |||
how to retrieve a deleted file in excel | Excel Discussion (Misc queries) | |||
How do I retrieve a deleted file of Excel | Excel Worksheet Functions |