调用Workbooks.Add()时使用Powershell自动执行Excel 2007的异常 [英] Exception automating Excel 2007 with Powershell when calling Workbooks.Add()
本文介绍了调用Workbooks.Add()时使用Powershell自动执行Excel 2007的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码在Powershell V1(Excel 2007)中引发异常:
The following code throws an exception in Powershell V1 (Excel 2007):
$E = New-Object -COM "Excel.Application"
$E.Visible = $True
$wb = $E.Workbooks.Add() #<<<Exception here
该错误表明格式可能过旧或类型库无效(从西班牙语翻译).类似的Word脚本也可以正常工作.
The error says that the format might be old or that the type library is not valid (translated from Spanish). A similar script for Word works just fine.
推荐答案
查看全文