0
它是在Excel 2003中VBAPowershell:如何设置excel应用程序的计算模式?
Application.Calculation = xlCalculationManual
我想实现在PowerShell中的相同。这是我做过什么:
$excel = New-Object -com Excel.Application
$xlCalculationManual = -4135
$excel.Calculation = $xlCalculationManual
值-4135从那里得到:http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.constants%28v=office.14%29.aspx
它抛出一个异常:
Exception setting "Calculation": "Unable to set the Calculation property of the Application class"
At C:\Documents and Settings\AUser\Desktop\ppp2eikon.ps1:11 char:8
+ $excel. <<<< Calculation = $xlCalculationManual
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
什么是设置此属性的正确方法?