2012-03-12 3 views
0

은 내가 PowerShell에서 동일한을 달성하고자하는 Excel 2003의 VBAPowershell : Excel 응용 프로그램의 계산 모드를 설정하는 방법은 무엇입니까?

Application.Calculation = xlCalculationManual 

입니다. 내가 무슨 짓을 :

$excel = New-Object -com Excel.Application 
$xlCalculationManual = -4135 
$excel.Calculation = $xlCalculationManual 

값은 -4135 거기에서 얻을 수있다 :

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 

이 속성을 설정하는 적절한 방법은 무엇입니까 : http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.constants%28v=office.14%29.aspx

그것은 예외가 발생?

답변

1

최소 하나 이상의 열려있는 통합 문서가없는 경우 VBA에서는 계산 모드를 설정할 수 없습니다. 오류 발생 : 1004 - 응용 프로그램 정의 또는 개체 정의 오류

통합 문서를 먼저 열어보십시오.

관련 문제