首页 > 代码库 > 计算Excel中的Sheet个数

计算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()

计算Excel中的Sheet个数