PowerShell : 통합 문서 클래스의 열린 속성을 가져올 수 없습니다


0

그래서 PowerShell을 사용하여 Excel 파일을 열려고합니다. 그러나 "이 통합 문서 클래스의 열린 속성을 가져올 수 없습니다"라는 오류 메시지가 나타납니다.

$dirPath = ("C:\Users\localadmin\OneDrive\DailyReports\")
$manFile = Get-ChildItem -Path $dirPath -Recurse -Filter "*MANSUM*"
$manPath = $manFile.Fullname
$excel = New-Object -ComObject Excel.Application
$excel.DisplayAlerts = $false
$manWB = $excel.Workbooks.Open($manPath)

이 오류를 어떻게 해결할 수 있습니까?

전체 경로 ( $manPath)가 정확합니다.

Windows 10 Pro, Excel 2016 실행


테스트 할 때 주목 Get-ChildItem해야 할 점 은 파일 이름에 대한 필터가 특별히 Excel 파일을 가리켜 야하므로 $manFile = Get-ChildItem -Path $dirPath -Recurse -Filter "*MANSUM*.xlsx"예를 들어 시도 하고 도움이되는지 확인하십시오.
Pimp Juice IT

답변:


0

해결책은 다음과 같습니다.

폴더를 만들고 적절한 액세스 권한을 제공해야합니다.

・ Windows 2008 Server x64

이 폴더를 만드십시오.

C : \ Windows \ SysWOW64 \ config \ systemprofile \ Desktop

・ Windows 2008 Server x86

이 폴더를 만드십시오.

C : \ Windows \ System32 \ config \ systemprofile \ Desktop

참조 : https://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008- x64? forum = 혁신 사무소

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.