VBScript创建Excel 2016对象 [英] VBScript create excel 2016 object

查看:161
本文介绍了VBScript创建Excel 2016对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计算机上安装了两个版本的excels(2010和2016).我想在excel 2016上运行vbscript.

I have two versions of excels(2010 and 2016) installed on my machine. I would like to run a vbscript on excel 2016.

但是

CreateObject("Excel.Application") 

仅创建excel2010.如何将其更改为2016?

only creates excel 2010. How can i change this to 2016?

推荐答案

在2016年,您可以尝试CreateObject("Excel.Application.16").

For 2016, you could try CreateObject("Excel.Application.16").

但是,请参阅下面的注释,因为不能保证此注释对于最新版本有效. 这以前对我有效,适用于2010年以前的版本.

However, see the comments below as this is not guaranteed to work for recent versions. This has worked for me before for versions up-to and including 2010.

请注意,早期版本没有如此直接的对应关系,2016 =>16.例如,我相信Office 2010 => 14.

Note that earlier versions don't have such a straightforward correspondence, 2016 => 16. For example, I believe Office 2010 => 14.

这篇关于VBScript创建Excel 2016对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆