我需要从Powershell中读取Excel文件。
我正在使用下面这个对象:
$objExcel=New-Object -ComObject Excel.Application
在安装了Office的计算机上,它可以正常运行。但如果没有安装Office,将会出现以下错误:
Retrieving the COM class factory for component with CLSID {} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Office是否有可用的运行时环境?