计算Excel中的Sheet个数

$strpath="d:\ee.xlsx"
$excel=new-object -comobject excel.application
$WorkBook = $excel.Workbooks.Open($strpath)
($WorkBook.worksheets).count
$excel.Quit()
$WorkSheet =$null
$WorkBook = $null
$excel = $null
[GC]::Collect()

posted on 2014-12-24 10:49  momingliu11  阅读(891)  评论(0编辑  收藏  举报