Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to list what references any givin hyperlink in excel | Excel Discussion (Misc queries) | |||
Extract External Data according to a list of references | Excel Discussion (Misc queries) | |||
Excel 2002 : How to extract references from a list ? | Excel Discussion (Misc queries) | |||
How do I ignore blanks within my list without losing references? | Excel Discussion (Misc queries) | |||
VBA References List | Excel Programming |