VB脚本-同时安装Excel 2003和Excel 2007时显式调用Excel 2007 [英] VB Script - Calling Excel 2007 explicitly when both Excel 2003 and Excel 2007 are installed

查看:154
本文介绍了VB脚本-同时安装Excel 2003和Excel 2007时显式调用Excel 2007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PC既安装了Excel 2003和2007,也安装了Excel 2007兼容包,它还具有VB脚本,可自动将记录构建到csv文件中.最近,需要转储到文件中的记录数量已经大大增加,并且超出了Excel 2003中的行数限制.因此,我制作了同一文件的副本并将其保存为.xlsm格式. 但是,当我使用VBScript通过以下方式在Excel电子表格后面运行宏时:

My PC has both Excel 2003 and 2007 as well as the Excel 2007 compatibility pack installed, it also has a VB script that build records into an csv file automatically. Recently, the number of records that are needed to dump into the file has grown significantly and went beyond the row limit in Excel 2003. As such, I made a copy of the same file and saved it into .xlsm format. However, when I use the VBScript to run the macro behind the Excel spreadsheet by calling:

Set myApp = CreateObject("Excel.Application")

Excel文件仍然尝试打开自身以将其转换(使用兼容包)到Excel 2003并在Excel 2003中运行,这不可避免地在每次运行时都会出现错误.

The Excel file still attempted to open itself to convert (using the compatibility pack) to Excel 2003 and run in Excel 2003, which inevitably gives an error every time it runs.

有什么办法可以迫使Excel.Application指向Excel 2007而不是Excel 2003?

Is there any way I could force Excel.Application to point to Excel 2007 instead of Excel 2003?

谢谢!

推荐答案

我有类似的经历,我正在运行Office 2010,并且我想使用直到Office 2003才可用的Office代理. 所以我在盒子上安装了Excel 2003,但没有工作.

I had a similar experience, I am running office 2010 and i want to use the Office agents available until Office 2003. so I installed Excel 2003 on my box and i didnt worked.

我找到了这篇文章,并尝试了所有选项. 重新研究我发现我应该使用:

I found this post and tried all options. reaseaching i found that i should use:

Set myApp = CreateObject("Excel.Application.11") 

对于Office 2003,但无法正常工作.

for office 2003 but it didnt work.

我所有的测试都是在VBSedit软件中完成的,这表明它使用的是Office 2003,但实际上是在2007年开放的.

All my testing was done in VBSedit software, which shows that it was using the office 2003, but it was actually opening 2007.

我尝试过primalscript,并且工作时像魔术一样.

I tried with primalscript and is working like a charm.

我认为这可能对其他人有帮助.

I think this might help others.

这篇关于VB脚本-同时安装Excel 2003和Excel 2007时显式调用Excel 2007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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