PowerShell

$xl = new-object -comobject Excel.Application

$source_wb = $xl.workbooks.open($source)
$xl.visible=$false
$type=$xl.GetType()
$ret=$type.InvokeMember("Run",[Reflection.BindingFlags]::InvokeMethod,$null,$xl,$param)
Write-Host $ret
$xl.Quit()

$currentThread.CurrentCulture = $oldci
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl)
Remove-Variable xl
原文地址:https://www.cnblogs.com/dufu/p/8391954.html