Discuz!NT
欢迎 游客 , 注册 | 登录 | 会员 | 界面 | 简洁版本 | 在线 | 帮助
商都网教育宝典宝库

发表新主题 回复该主题
本主题被查看562次, 共1个帖子, 1页, 当前为第1页     选择页数: 1      跳转到第   上一主题   下一主题
标题: 获得Excel文件的sheet名称和数量
-[尕硴]
超级版主
UID: 71
来自:
精华: 130
积分: 14003
帖子: 12909
注册: 2007-10-22 17:59:00
状态: 离线
威望: 444.00
金钱: 3355.00 元
只看楼主 2008-01-28 15:48
获得Excel文件的sheet名称和数量
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的代码与释放变量
#1  
发表新主题 回复该主题
本主题被查看562次, 共1个帖子, 1页, 当前为第1页     选择页数: 1      跳转到第







现在的时间是 2008-10-13 15:14:21

版权所有 商都网教育宝典
         Powered by Discuz!NT 1.0.6666    Copyright © 2001-2008 Comsenz Inc.
Processed in 0.128 seconds