Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterate through the references in Visual Basic Code

Status
Not open for further replies.

CaneMan

IS-IT--Management
Feb 19, 2004
9
US
I have a visual basic 6 project that I would like to
iterate through the references in code and check to make
sure they are not broken. I have found code to use VB
extensibility but it is not working. any ideas will be
greatly appreciated
 
Dim ref as reference
dim strRefLine as string

For i = 1 To References.Count
strRefLine = ""
Set ref = References(i)
strRefLine = ref.Name & vbTab & ref.Major & "." & ref.Minor & vbTab & "Built In: " & ref.BuiltIn & _
vbTab & "Kind: " & ref.Kind & vbTab & "Broken: " & ref.IsBroken & vbTab & ref.Guid & _
vbCrLf & ref.FullPath
Write_To_Log strRefLine
Next i


"Have a great day today and a better day tomorrow!
 
I put that code in my project and I get a runtime error 424
object required on this line
For i = 1 To References.Count
 
Oops, my bad... The code I provided was in VBA -- not VB6.

I've searched for a while now and can't find how to get the list at execution time.

I found one link that MAY help, but not sure:

Not that this helps any, but I can open the exe in word and see all "dll's", or I can open the "xxx.vbp" file to see all references (except the required few).

Sorry.

"Have a great day today and a better day tomorrow!
 
If you compile you will find references that are broken (not quite what you asked)

If you open the project file in a text editor you will be able to read the references in there. Same applies to opening any forms in a text editor. You will see in a textual form, what references are required by that form.

If you can obtain a references list during runtime then it would be interesting to find out how.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top