64位Excel Office 2010:自动化错误%1不是有效的Win32应用程序。

时间:2012-11-19 05:51:54

标签: excel-vba automation 64-bit excel-2010 vba

此功能适用于Microsoft Office 32位。但是当转移到64位时,出现错误“自动化错误%1不是有效的Win32应用程序”。

Private Function CreateUsingManifest(nameOfClass As String) As Object
    Dim actCtx As Object

    Set actCtx = CreateObject("Microsoft.Windows.ActCtx")


    On Error GoTo InvalidManifest
    Set CreateUsingManifest = actCtx.CreateObject(nameOfClass) 'Error here

    Set actCtx = Nothing
    On Error GoTo 0
    Exit Function

InvalidManifest:
    Err.Raise  "Automation error %1 is not a valid Win32 application."
End Function

0 个答案:

没有答案