zoukankan      html  css  js  c++  java
  • 获取Excel的sheet名称和数量

    string name=sheet.Name; //获取该sheet的名称
       string amount=book.WorkSheets.Count.ToString(); //获取该book的sheet数量。
         string sSheetName=null;
         object missing = Missing.Value;
          OleDbConnection conn = new OleDbConnection();
          Excel.Application excelApp = new Excel.Application();
         excelApp.Application.Workbooks.Open(path, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,Missing.Value ,Missing.Value,Missing.Value,Missing.Value ,Missing.Value ,Missing.Value );
           for (int i = 0; i < excelApp.Workbooks[1].Worksheets.Count; i++)
            {
              Excel.Worksheet ws = (Excel.Worksheet)excelApp.Workbooks[1].Worksheets[1];
              sSheetName = ws.Name;
            }
  • 相关阅读:
    三、linux系统管理
    二、基本命令
    一、基本环境
    mysql-day4
    mysql-day3
    mysql-day2
    mysql-day1
    3、线性表的链式存储结构
    2、线性表之顺序表
    1、时间复杂度
  • 原文地址:https://www.cnblogs.com/umlzhang/p/1455013.html
Copyright © 2011-2022 走看看