错误13:类型不匹配

时间:2013-04-16 11:02:27

标签: vba add-in adobe-indesign

我有一个示例添加excel的内容: 我将对象InDesign称为:

 Private Sub btnStart_Click()
    Dim pCnt As Integer
    Dim myInDesign As InDesign.Application
    Dim myDoc As InDesign.Document
    Dim myPage As InDesign.Page

    ActiveWorkbook.Colors(17) = RGB(255, 204, 255)
    Set myInDesign = CreateObject("InDesign.Application")
    Set myDoc = myInDesign.ActiveDocument

    Set myInDesign = Nothing
    Set myDoc = Nothing

    Unload Me
End Sub

Error 13: Type mismatch

显示Set myInDesign = CreateObject("InDesign.Application")

为什么呢?如何解决?谢谢大家。

1 个答案:

答案 0 :(得分:1)

我在http://forums.adobe.com/thread/834780

找到答案

删除文件C:\ ProgramData \ Adob​​e \ InDesign \ Version 6.0 \ en_US \ Scripting Support \ 6.0 \ Resources for Visual Basic.tlb 并使用权限admin运行excel和indesign