for (i=0;i<Excel.Worksheets.Count;i++)
{
    Excel.Worksheets[i]
}

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/2610/2610814.xml?temp=.1816828
      

  2.   

    我看到用如下源代码来获得一个excel文件的全部表名称:
    string strCon = string.Format(" Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = {0};Extended Properties=Excel 8.0",fileName);ADOX.CatalogClass catalog = new ADOX.CatalogClass();
    _connection = new ADODB.ConnectionClass();_connection.Open(strCon, null, null, 0);catalog.ActiveConnection = _connection;foreach(ADOX.Table table in catalog.Tables)
    {
    string tablename = table.Name;}_connection.Close();需要添加ADO 2。7 和 ADO2。7 FOR DLL AND SECTURITY