.FullPath中的ActiveVBProject.References错误

我们有一个模块,用于检查机器信息以进行故障排除。 其中一个子模块检查每个引用的中断。 但是,对于单个引用,Microsoft Office Soap Library 3.0会在发生错误时停止。

我们可以解决它,但我真的很想知道是什么导致这个错误。 这个参考是有效的,没有被破坏。 引用对象的方法简单地失败了这个库。

对象'Reference'的方法'FullPath'失败

Private Sub getEachRef() Dim ref As Variant Dim strRef As String 'On Error Resume Next <- this allows the rest of the code to complete For Each ref In Application.VBE.ActiveVBProject.References frmAbout.lst_About.AddItem "[Reference] " & ref.Description frmAbout.lst_About.List(frmAbout.lst_About.ListCount - 1, 1) = ref.FullPath <- error is here If ref.IsBroken = True Then frmAbout.lst_About.List(frmAbout.lst_About.ListCount - 1, 2) = "Broken Link" End If Next End Sub