Dim ExcelApp As New Microsoft.Office.Interop.Excel.ApplicationClass
Dim WorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim WorkSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim intSheetCount as Integer
Dim strFileName As String = "C:\AAA.xls" '你的檔案所在路徑
WorkBook = ExcelApp.Workbooks.Open(strFileName)
intSheetCount = WorkBook.Worksheets.Count '此處抓到Sheet數量
Dim WorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim WorkSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim intSheetCount as Integer
Dim strFileName As String = "C:\AAA.xls" '你的檔案所在路徑
WorkBook = ExcelApp.Workbooks.Open(strFileName)
intSheetCount = WorkBook.Worksheets.Count '此處抓到Sheet數量
文章標籤
全站熱搜

這是vb.net的寫法,不是c# ~"~