【问题标题】:Vbs on Excel Starter 2010: activex component can't create object Excel.ApplicationExcel Starter 2010 上的 Vbs:activex 组件无法创建对象 Excel.Application
【发布时间】:2015-04-29 00:52:43
【问题描述】:

我有一台预装了 Windows 7 和 Office Starter 2010 的新电脑。如果我启动以下简单的 vb 脚本(从命令行:cscript testScript.vbs):

Dim xlApp
Set xlApp = CreateObject("Excel.application")
xlApp.visible = True
Set xlWorkbooks = xlApp.Workbooks
Set xlWorkbook = xlWorkbooks.Open("C:\path\myFile.xls")
xlWorkbook.ActiveSheet.Rows("1:2").AutoFit
xlApp.visible = False
xlWorkbook.Save
xlWorkbook.Close("C:\path\myFile.xls")
xlApp.Quit
Set xlApp = Nothing

它返回此错误:activex 组件无法创建对象'Excel.Application'。 我不明白这个错误是不是由于 Starter 限制 (http://office.microsoft.com/en-us/starter-help/excel-features-that-are-not-fully-supported-in-excel-starter-HA010374501.aspx),我在网上发现了不同意见。

有没有办法让它使用 Office Starter 版本?

【问题讨论】:

    标签: excel vbscript


    【解决方案1】:

    尽管这已经是一个非常古老的问题,但我决定发布以下信息只是为了帮助其他谷歌人。

    由于您尝试在 VBA 之外创建 Excel.Application 的实例,因此如果您在目标计算机上安装 Microsoft Excel Viewer 的更新版本,则很有可能成功。这将允许您访问 Excel 的 API

    请记住,Excel Starter Edition 不支持宏以及other important limitations

    干杯!

    【讨论】:

    • 它对我不起作用。安装整个 Office 也没有解决问题。
    猜你喜欢
    • 2023-03-16
    • 2011-02-13
    • 1970-01-01
    • 1970-01-01
    • 2014-09-26
    • 2010-12-25
    • 2014-11-07
    相关资源
    最近更新 更多