打印本文 打印本文  关闭窗口 关闭窗口  
获得Excel文件的sheet名称和数量
作者:佚名  文章来源:不详  点击数  更新时间:2008/4/18 14:54:43  文章录入:杜斌  责任编辑:杜斌

  Dim ex As Excel.Application
  Dim exwbook As Excel.Workbook
  Dim exsheet As Excel.Worksheet
  Dim x As String
  Dim shetcounts As Integer
  shetcounts = 0
  Set ex = CreateObject("Excel.Application")
  Set exwbook = ex.Workbooks.Open(ThisWorkbook.Path & "\Book1.xls")
  For Each ws In Worksheets
  MsgBox ws.Name
  Next ws
  '别忘了加上关闭EXCEL的代码与释放变量
打印本文 打印本文  关闭窗口 关闭窗口