2013-04-16 95 views
-1

我有一個例子添加的Excel的插件: 我調用對象的InDesign爲:錯誤13:類型不匹配

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")

爲什麼?如何修復?謝謝大家。

+1

Dim myInDesign as Object,or Set myInDesign = New InDesign.Application取決於你的插件構造函數 – 2013-04-16 11:04:54

+0

如果安裝了'CS5',或者在黑暗的'CreateObject(「InDesign.Application.CS5」)'中有一個鏡頭? –

+0

我在WIN XP上運行正常,但在WIN 7上運行時顯示錯誤。 –

回答

1

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

刪除文件C:\ ProgramData \的Adobe \ InDesign中\ 6.0版\ EN_US \腳本支持\ 6.0 \對於Visual Basic.tlb 資源及運行Excel和InDesign許可管理