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

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

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

微信交流群(請(qǐng)用微信掃碼)

        

Access vba查看所有引用

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

在VBE窗口中,我們可以通過(guò)工具-引用,引用相關(guān)的庫(kù)類(lèi)文件。隻有引用瞭纔能調(diào)用。


在引用一些庫(kù)類(lèi)時(shí),往往是本地計(jì)祘機(jī)有,在其他未必有。所以我們需要判斷有成功引用對(duì)象。

在VBA中, 通過(guò)一箇自定義的函數(shù)來(lái)查看所有引用。

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

穫?cè)∫脤?duì)象

    分享
    文章分類(lèi)
    聯(lián)繫我們
    聯(lián)繫人: 王先生
    Email: 18449932@qq.com
    QQ: 18449932
    微博: officecn01
    移動(dòng)訪(fǎng)問(wèn)