OLEFormat.Object:未知的接口 [英] OLEFormat.Object : unknown interface

查看:241
本文介绍了OLEFormat.Object:未知的接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我使用VBA进行powerpoint报告,并且多年来一直运行良好。我的环境是Office 2013 + windows 10.。

I auomate powerpoint reports with VBA and it's been working very well for years. My environment is office 2013 + windows 10.

今天,同一个宏随机失败并在此声明过了一段时间后:

Today the very same macro fails at random and after some time elapsed on this statement :

Set WorkbookToUpdate = ShapeToUpdate.OLEFormat.Object

错误信息是'未知界面'。

The error message is 'unknown interface'.

宏一直是工作,我在同事的机器上遇到了这个问题。

The macro has always been working, I encounterd this issue on my colleagues' machines.

最终宏用于Office 2007。

Eventually the macro worked with office 2007.

我怀疑它必须Windows 10周年更新。

I have strong suspicions that it has to do with Windows 10 anniversary update.

任何线索?

问候,



Ghislain

Regards,

Ghislain

推荐答案

您好Ghislain,

Hi Ghislain,

您能否与我们分享更多信息?一个简单的代码将非常有用,然后我们可以尝试重现您的问题。

Could you share us more information? A simple code would be much helpful and then we could try to reproduce your issue.

根据错误消息,我建议您稍后尝试绑定,如下所示:

Based on error message, I suggest you try later binding, something like below:

' No reference to a type library is needed to use late binding.
' As long as the object supports IDispatch, the method can 
' be dynamically located and invoked at run-time.
' Declare the object as a late-bound object
  Dim oExcel As Object
  Set oExcel = CreateObject("Excel.Application")
' The Visible property is called via IDispatch
  oExcel.Visible = True

您可以参考以下链接获取更多信息。

You could refer the link below for more information.

#使用早期绑定和延迟在自动化中绑定

https://support.microsoft.com/en-us/kb / 245115

# Using early binding and late binding in Automation
https://support.microsoft.com/en-us/kb/245115

最诚挚的问候,

Edward


这篇关于OLEFormat.Object:未知的接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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