小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

VBA編輯器中的工具引用項(xiàng)目自動加載

 mmyechq 2013-01-28
1.要先取得 VBIDE 的 GUID(物件的類別識別項(xiàng))

做法:1、先手動引用 Microsoft Visual Basic for Applications Extensibility 5.3
         2、在【信任中心】設(shè)置界面中勾選【信任對VBA工程對象模型的訪問】

然後執(zhí)行以下程式碼來列出已引用項(xiàng)目的  GUID 資料
Sub ListReferences()
For Each Ref In ThisWorkbook.VBProject.References
i = i + 1
    Cells(i, 1) = Ref.Name
    Cells(i, 2) = Ref.GUID
    Cells(i, 3) = Ref.Major
    Cells(i, 4) = Ref.Minor
    Cells(i, 5) = Ref.FullPath
    Cells(i, 6) = Ref.Description
Next Ref
End Sub

這樣你就可以取得 Microsoft Visual Basic for Applications Extensibility 5.3 的 GUID 了

2、有了 GUID ,Major,Minor 三個(gè)值後,以後要用VBA自動引用Microsoft Visual Basic for Applications Extensibility 5.3 全靠它了

程式碼如下:

Sub MakeLibrary()
    On Error Resume Next                    'if it already exits
    ThisWorkbook.VBProject.References _
          .AddFromGuid "{0002E157-0000-0000-C000-000000000046}", 5, 3    '版本5.3
End Sub

Sub mm()
On Error Resume Next                    'if it already exits
    ThisDocument.VBProject.References _
          .AddFromGuid "{00020813-0000-0000-C000-000000000046}", 1, 6
    ThisDocument.VBProject.References _
          .AddFromGuid "{0D452EE1-E08F-101A-852E-02608C4D0BB4}", 2, 0
 End Sub

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多