-1

我有一个 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 mismatchSet myInDesign = CreateObject("InDesign.Application")

为什么?如何修复?谢谢大家。

4

1 回答 1

1

我在http://forums.adobe.com/thread/834780找到答案

删除文件 C:\ProgramData\Adobe\InDesign\Version 6.0\en_US\Scripting Support\6.0\Resources for Visual Basic.tlb 并以管理员权限运行 excel 和 indesign

于 2013-04-23T08:55:51.447 回答