码迷,mamicode.com
首页 > 其他好文 > 详细

释放用完的Excel COM组件

时间:2015-05-08 20:01:25      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

How to Open; SaveAs; then Close an Excel 2013 (macro-enabled) workbook from PowerShell4
 
1. (http://www.cnblogs.com/fuhj02/archive/2010/12/23/1914313.html)
$xl.Quit()
$ws = $null 
$wb = $null
$xl = $null 
[GC]::Collect()
 
2.(http://technet.microsoft.com/en-us/library/ff730962.aspx)
$wb.Close()
$ws = $null
$wb = $null
$xl.Quit() 
[System.Runtime.InteropServices.Marshal]::ReleaseComObject($xl)
Remove-Variable xl
 
参考:
http://stackoverflow.com/questions/19908302/how-to-open-saveas-then-close-an-excel-2013-macro-enabled-workbook-from-powe 

释放用完的Excel COM组件

标签:

原文地址:http://www.cnblogs.com/IvanChen/p/4488549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!