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