0

我有以下 vb 脚本,它从 .xlsx 文件打开工作表并将其保存为 csv 文件:

if WScript.Arguments.Count < 3 Then
    WScript.Echo "Error! Please specify the source path and the destination. Usage: sheet2csv SourcePath.xlsx worksheet Destination.csv"
    Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.Sheets(Wscript.Arguments.Item(1)).SaveAs WScript.Arguments.Item(2), 24
oBook.Close False
oExcel.Quit

我在我的 PC 上安装了 excel 2003,但我也可以通过运行以下命令通过 windows vApp 启动器访问 Excel 2007:

"C:\WINDOWS\CCM\VappLauncher.exe" /launch "Microsoft Office Excel 2007 VOE05891.100"

这是我可以访问 Excel 2007 的唯一方法 - 它没有实际安装在我的 PC 上,但 Excel 2003 是。

当脚本运行时,它会打开 Excel 2003 的本地实例。我想找到一种方法来修改 VB 脚本,以便它使用 Excel 2007 的虚拟化版本。任何人都可以帮忙吗?

4

0 回答 0