office交流網(wǎng)--QQ交流群號及微信交流群

Access培訓(xùn)群:792054000         Excel免費交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請用微信掃碼)

        

Access vba查看所有引用

2017-12-30 16:17:00
十段
轉(zhuǎn)貼
6273

在VBE窗口中,我們可以通過工具-引用,引用相關(guān)的庫類文件。只有引用了才能調(diào)用。


在引用一些庫類時,往往是本地計算機有,在其他未必有。所以我們需要判斷有成功引用對象。

在VBA中, 通過一個自定義的函數(shù)來查看所有引用。

Function ReferenceInfo()
   Dim strMessage As String
   Dim strTitle As String
   Dim refItem As Reference
   
   On Error Resume Next
   
   For Each refItem In References
      If refItem.IsBroken Then
         strMessage = "Missing Reference:" & vbCrLf & refItem.FullPath
      Else
         strMessage = "Reference: " & refItem.Name & vbCrLf _
            & "Location: " & refItem.FullPath & vbCrLf
      End If
      Debug.Print strMessage
   Next refItem
End Function

獲取引用對象

    分享
    文章分類
    聯(lián)系我們
    聯(lián)系人: 王先生
    Email: 18449932@qq.com
    QQ: 18449932
    微博: officecn01
    移動訪問