Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBE References List

Does anyone know how to get a list of the libraries available on a machine
using VBA scripting? (That is the list you see when you go to
Tools\References in VBE.)

I've developed some code which requires certain libraries be present/active,
and would like to do some preliminary work to verify and take corrective
action, if needed.

What I used so far within a For Loop is:

'ActiveWorkbook.VBProject.References.Item(i).Name'

This gives me a substantially truncated response which may be the same for
different library versions.

Regards,
VBA Dabbler
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default VBE References List

You might find this useful:

Sub ListAddinReferences()

'to list all the references installed in the add-in
'--------------------------------------------------

Dim i As Integer
Dim iRefCount As Integer

Range(Cells(1), Cells(iRefCount + 1, 6)).Clear

iRefCount = ThisWorkbook.VBProject.References.count

Cells(1).Value = "Name"
Cells(2).Value = "Description"
Cells(3).Value = "FullPath"
Cells(4).Value = "GUID"
Cells(5).Value = "Major"
Cells(6).Value = "Minor"

With ThisWorkbook.VBProject.References
For i = 1 To iRefCount
Cells(i + 1, 1).Value = .Item(i).Name
Cells(i + 1, 2).Value = .Item(i).Description
Cells(i + 1, 3).Value = .Item(i).FullPath
Cells(i + 1, 4).Value = .Item(i).GUID
Cells(i + 1, 5).Value = .Item(i).Major
Cells(i + 1, 6).Value = .Item(i).Minor
Next i
End With

Range(Cells(1), Cells(6)).Font.Bold = True
MediumBorder Range(Cells(1), Cells(6))
Range(Cells(1), Cells(iRefCount + 1, 6)).Columns.AutoFit

End Sub


RBS


"VBA Dabbler" wrote in message
...
Does anyone know how to get a list of the libraries available on a machine
using VBA scripting? (That is the list you see when you go to
Tools\References in VBE.)

I've developed some code which requires certain libraries be
present/active,
and would like to do some preliminary work to verify and take corrective
action, if needed.

What I used so far within a For Loop is:

'ActiveWorkbook.VBProject.References.Item(i).Name'

This gives me a substantially truncated response which may be the same for
different library versions.

Regards,
VBA Dabbler


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBE References List

Yes, I did find it useful - thanks.

Do you know how to get a list of references that are available on the
machine running VBA code?

Regards,
VBA Dabbler

"RB Smissaert" wrote:

You might find this useful:

Sub ListAddinReferences()

'to list all the references installed in the add-in
'--------------------------------------------------

Dim i As Integer
Dim iRefCount As Integer

Range(Cells(1), Cells(iRefCount + 1, 6)).Clear

iRefCount = ThisWorkbook.VBProject.References.count

Cells(1).Value = "Name"
Cells(2).Value = "Description"
Cells(3).Value = "FullPath"
Cells(4).Value = "GUID"
Cells(5).Value = "Major"
Cells(6).Value = "Minor"

With ThisWorkbook.VBProject.References
For i = 1 To iRefCount
Cells(i + 1, 1).Value = .Item(i).Name
Cells(i + 1, 2).Value = .Item(i).Description
Cells(i + 1, 3).Value = .Item(i).FullPath
Cells(i + 1, 4).Value = .Item(i).GUID
Cells(i + 1, 5).Value = .Item(i).Major
Cells(i + 1, 6).Value = .Item(i).Minor
Next i
End With

Range(Cells(1), Cells(6)).Font.Bold = True
MediumBorder Range(Cells(1), Cells(6))
Range(Cells(1), Cells(iRefCount + 1, 6)).Columns.AutoFit

End Sub


RBS


"VBA Dabbler" wrote in message
...
Does anyone know how to get a list of the libraries available on a machine
using VBA scripting? (That is the list you see when you go to
Tools\References in VBE.)

I've developed some code which requires certain libraries be
present/active,
and would like to do some preliminary work to verify and take corrective
action, if needed.

What I used so far within a For Loop is:

'ActiveWorkbook.VBProject.References.Item(i).Name'

This gives me a substantially truncated response which may be the same for
different library versions.

Regards,
VBA Dabbler



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBE References List

As far as I know, there is no way to get the list of all
available references. You can only get those that are in use.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"VBA Dabbler" wrote in
message
...
Yes, I did find it useful - thanks.

Do you know how to get a list of references that are available
on the
machine running VBA code?

Regards,
VBA Dabbler

"RB Smissaert" wrote:

You might find this useful:

Sub ListAddinReferences()

'to list all the references installed in the add-in
'--------------------------------------------------

Dim i As Integer
Dim iRefCount As Integer

Range(Cells(1), Cells(iRefCount + 1, 6)).Clear

iRefCount = ThisWorkbook.VBProject.References.count

Cells(1).Value = "Name"
Cells(2).Value = "Description"
Cells(3).Value = "FullPath"
Cells(4).Value = "GUID"
Cells(5).Value = "Major"
Cells(6).Value = "Minor"

With ThisWorkbook.VBProject.References
For i = 1 To iRefCount
Cells(i + 1, 1).Value = .Item(i).Name
Cells(i + 1, 2).Value = .Item(i).Description
Cells(i + 1, 3).Value = .Item(i).FullPath
Cells(i + 1, 4).Value = .Item(i).GUID
Cells(i + 1, 5).Value = .Item(i).Major
Cells(i + 1, 6).Value = .Item(i).Minor
Next i
End With

Range(Cells(1), Cells(6)).Font.Bold = True
MediumBorder Range(Cells(1), Cells(6))
Range(Cells(1), Cells(iRefCount + 1, 6)).Columns.AutoFit

End Sub


RBS


"VBA Dabbler" wrote in
message
...
Does anyone know how to get a list of the libraries
available on a machine
using VBA scripting? (That is the list you see when you go
to
Tools\References in VBE.)

I've developed some code which requires certain libraries be
present/active,
and would like to do some preliminary work to verify and
take corrective
action, if needed.

What I used so far within a For Loop is:

'ActiveWorkbook.VBProject.References.Item(i).Name'

This gives me a substantially truncated response which may
be the same for
different library versions.

Regards,
VBA Dabbler





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBE References List

I presume you are referring to within VBA. Do you think that a list of all
available references could be retrieved via API calls?

Regards,
VBA Dabbler

"Chip Pearson" wrote:

As far as I know, there is no way to get the list of all
available references. You can only get those that are in use.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"VBA Dabbler" wrote in
message
...
Yes, I did find it useful - thanks.

Do you know how to get a list of references that are available
on the
machine running VBA code?

Regards,
VBA Dabbler

"RB Smissaert" wrote:

You might find this useful:

Sub ListAddinReferences()

'to list all the references installed in the add-in
'--------------------------------------------------

Dim i As Integer
Dim iRefCount As Integer

Range(Cells(1), Cells(iRefCount + 1, 6)).Clear

iRefCount = ThisWorkbook.VBProject.References.count

Cells(1).Value = "Name"
Cells(2).Value = "Description"
Cells(3).Value = "FullPath"
Cells(4).Value = "GUID"
Cells(5).Value = "Major"
Cells(6).Value = "Minor"

With ThisWorkbook.VBProject.References
For i = 1 To iRefCount
Cells(i + 1, 1).Value = .Item(i).Name
Cells(i + 1, 2).Value = .Item(i).Description
Cells(i + 1, 3).Value = .Item(i).FullPath
Cells(i + 1, 4).Value = .Item(i).GUID
Cells(i + 1, 5).Value = .Item(i).Major
Cells(i + 1, 6).Value = .Item(i).Minor
Next i
End With

Range(Cells(1), Cells(6)).Font.Bold = True
MediumBorder Range(Cells(1), Cells(6))
Range(Cells(1), Cells(iRefCount + 1, 6)).Columns.AutoFit

End Sub


RBS


"VBA Dabbler" wrote in
message
...
Does anyone know how to get a list of the libraries
available on a machine
using VBA scripting? (That is the list you see when you go
to
Tools\References in VBE.)

I've developed some code which requires certain libraries be
present/active,
and would like to do some preliminary work to verify and
take corrective
action, if needed.

What I used so far within a For Loop is:

'ActiveWorkbook.VBProject.References.Item(i).Name'

This gives me a substantially truncated response which may
be the same for
different library versions.

Regards,
VBA Dabbler





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to list what references any givin hyperlink in excel dijimajik Excel Discussion (Misc queries) 0 September 24th 07 09:34 PM
Extract External Data according to a list of references Sarah (OGI) Excel Discussion (Misc queries) 0 April 20th 07 02:20 PM
Excel 2002 : How to extract references from a list ? Mr. Low Excel Discussion (Misc queries) 6 December 2nd 06 10:48 PM
How do I ignore blanks within my list without losing references? sessc Excel Discussion (Misc queries) 2 July 29th 05 02:53 PM
VBA References List R Avery Excel Programming 2 January 10th 04 01:11 AM


All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"