excel自动化办公室2013年文件错误 [英] excel automation office 2013 over document error

查看:90
本文介绍了excel自动化办公室2013年文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Excel文件的Ole Control,从vb6 embbeded打开。 

此程序已成功使用excel版本2003~2010。

但我在Excel 2010更新版本中遇到问题。

它被使用了代码存在问题

I have a Ole Control with Excel file open from vb6 embbeded. 
This program was Sucessfully used excel version 2003~ 2010.
But I have a problem from the Excel 2010 later version.
It was used There is a problem with code

type1



设置excel =新的Excel.Application

设置excelbook = oExcel.Workbooks.Open(" C:\ temp \test1.xlsx")

type1

Set excel = New Excel.Application
Set excelbook = oExcel.Workbooks.Open("C:\temp\test1.xlsx")

以下代码,它非常好但是对于下面的代码,存在一个问题,即Excel的每个控件

type2



设置excelbook = GetObject(" C:\ temp \test1.xlsx"," Excel.Sheet")

the following code,it is very well but for the code below there is a problem that each of the control of Excel
type2

Set excelbook = GetObject("C:\temp\test1.xlsx", "Excel.Sheet")

在excel 2013中,输入1和type2有什么区别?

用什么其他比较方法(type1,type2)来查找差异excel实例?

In excel 2013, type 1 and type2 what difference?
What other comparative method(type1,type2) applied to find the differences excel instance?

注意c#,vc ++ excel实例中的同样问题

Note that The same problem in c#,vc++ excel instance



推荐答案

>>>在excel 2013中,输入1和type2有什么区别?



根据你的说明,type1是启动一个新的Microsoft Excel实例。



作为type2,如果执行此代码时正在运行Microsoft Excel实例,则可以访问通过excelbook变量运行实例的对象模型。如果没有实例正在运行,则会收到以下可捕获的运行时错误消息:

>>>In excel 2013, type 1 and type2 what difference?

According to your description, type1 is to start a new instance of Microsoft Excel.

As type2, if an instance of Microsoft Excel is running when this code is executed, you have access to the running instance's object model through the excelbook variable. If no instance is running, you receive the following trappable run-time error message:

运行时错误'429':

ActiveX组件无法创建对象



有关详细信息,请参阅
Office自动化服务器的GetObject和CreateObject行为




感谢您的理解。

Run-time error '429':
ActiveX component can't create object

For more information, please refer to GetObject and CreateObject behavior of Office automation servers

Thanks for your understanding.


这篇关于excel自动化办公室2013年文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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