Excel, save and close after run

前端 未结 5 803
执笔经年
执笔经年 2020-12-06 08:16

how can I save the below script after it has run?

Script is from: Powershell Disk Usage Report

$erroractionpreference = \"SilentlyContinue\"
$a = New         


        
5条回答
  •  误落风尘
    2020-12-06 08:47

    As mentioned in MSDN documentation here, the ReleaseComObject call only decrements the reference counter of that COM object by 1. If your scripts has multiple references of the same COM object, It will not release the object.

    The documentation recommends using FinalReleaseComObject method to completely release the COM object and close the Excel process once in for all.

    Just be sure to call this method only when you are done with the COM reference, as not doing so may lead to bugs which are hard to debug.

提交回复
热议问题