簡體   English   中英

Excel Starter 2010上的Vb:ActiveX組件無法創建對象Excel.Application

[英]Vbs on Excel Starter 2010: activex component can't create object Excel.Application

我有一台預裝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版本工作?

盡管這個問題已經很老了,但我還是決定發布以下信息,僅是為了幫助其他Google員工。

由於您嘗試在VBA外部創建Excel.Application的實例,因此如果在目標計算機上安裝Microsoft Excel Viewer的更新版本,則很有可能成功。 這將允許您訪問Excel的API

請記住, Excel Starter Edition不支持宏以及其他重要限制

干杯!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM