Link to home
Start Free TrialLog in
Avatar of ChristineT
ChristineT

asked on

how to make a list of references in vb6 project

Does anyone have code to list the names and paths of references from within a vb6 project?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

I don't know that you can do that, but if you go into Project|References all the ones that are in use will be shown at the top and clicking on one will show where it is.
Avatar of ChristineT
ChristineT

ASKER

Thanks Martin,
I know I can do that but was feeling lazy and hoping I could just run a routine to see them all listed. I do that in Access projects and thought it would be real straight forward like it is there.

What I do in Access is iterate through:
For Each ref In Application.References

But I don't now how to get the references of the VB project. It really seems as if it should be totally simple.

Thanks anyway.
I assume that the "App" object(?) is equivalent to Access' "Application" object and if so there is no App.References, or anything close. If you look at the VBP file in Notepad or some other text editor you'll see that there are Reference= entries for the references other than the ones that I assume every VB6 project includes and they are "Visual Basic for Applications", "Visual Basic runtime objects and procedures" and "Visual Basic objects and procedures". I guess you could "hard code" those three in your list and then open the VBP file as a text file and read through it looking for the "Reference=" lines. Other thatthat I'm out of ideas.
Thanks for your responses Martin. I do not consider them to be solutions but I do appreciate your time and effort. I do not consider this issue resolved, but since I am getting notifications that I must close this question, I am giving up on the thought that what I want to do is possible and will try to close this thread.
I've requested that this question be closed as follows:

Accepted answer: 0 points for ChristineT's comment #a40612649

for the following reason:

I would still like to be able to do what I wanted, but am giving up on this at this point.
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Martin, I just requested to re-open this thread.
Thanks for the VB project. I would like to try it out, but got an error log when I opened the project, and cannot make the exe:
Error Log:
Line 21: Class MSComDlg.CommonDialog of control CommonDialog1 was not a loaded control class.
Line 24: The property name _ExtentX in CommonDialog1 is invalid.
Line 25: The property name _ExtentY in CommonDialog1 is invalid.
Line 26: The property name _Version in CommonDialog1 is invalid.

What do I need to do to get past this?  I really appreciate your help.

Thanks,
Christine
Just to make sure that what I upload works, I downloaded it from post ID: 40612720, expanded the zip file and opened and ran it without problems. That makes me think that you have a problem with your commondialog control. Please see this thread. If that doesn't work you could modify the project to get the path + filename manually from a textbox.
Thank you Martin. This is not exactly what I wanted, but it might come in handy some time. I appreciate your help and your patience with me since I am pretty new to using this forum and also VB is not my most usual development environment.
Thank you so much,
Christine
Christine it looks like reopening the question caused your points award to me to be lost. Could you do it again please?
Thank you Martin, I really appreciate your help with this. Your solution was not exactly what I was looking for, but I'm sure it will come in handy some time. I modified it a bit and got it working.  I also appreciate your patience and your courtesy. I am pretty new to Experts Exchange and also VB is not my 'usual development environment'. Hopefully I am doing this step correctly :)
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014