当前位置: 代码迷 >> PB >> ,win7,office2010下,不能打开excel
  详细解决方案

,win7,office2010下,不能打开excel

热度:143   发布时间:2016-04-29 09:15:57.0
求助,win7,office2010下,不能打开excel
powerbuilder 9.0  
操作系统:win7  
office版本:microsoft excel starter 2010 


oleobject xlapp
xlapp = Create oleobject
ret = xlapp.connectToNewObject("Excel.application")
if ret < 0 then
messagebox("错误","连接到excel失败,请确认系统是否安装Excel")
messagebox("",string(ret))
end if

上面语句执行 ret 返回 -2 Class name not found

怎么办?
如果我安装上office2003,就可以通过,但是不想安装office2003.

------解决方案--------------------
查一下VBA ,看看是不是EXCEL 更改了OLE 接入名称。
------解决方案--------------------
试了试你的代码,没有问题,我是的office 2010 标准版

应该和你的office版本有关
  相关解决方案