![]() |
Check for the Newest Available Library
Hello all! I was wondering if there was a way to programmatically get
a list of available reference libraries on the running computer and then determine which library of a certain type is the newest, such as the newest version of ADO? Thank you! Cory |
Check for the Newest Available Library
You would need to know the filenames and the current version of each
object library. You could iterate through the collection like this: For i = 1 To ThisWorkbook.VBProject.References.Count MsgBox "Name: " & _ ThisWorkbook.VBProject.References.item(i).Name & vbCr & _ "Path: " & _ ThisWorkbook.VBProject.References.item(i).FullPath Next i You could use code like this to test out if a reference is available: On Error Resume Next ' add a reference to MS Word 2003 ThisWorkbook.VBProject.References.AddFromFile _ ("C:\Program Files\Microsoft Office\Office11\MSWORD.OLB") On Error Goto 0 If Err = 0 Then ' your code continues Else MsgBox "MS Word 2003 not available on this computer" End If Each ADO library has a different filename so you could use the first code to see if it is already installed. Then you can use the second code to add it, if it isn't installed. This is air code so test it first. HTH, JP On Apr 7, 1:47*pm, " wrote: Hello all! *I was wondering if there was a way to programmatically get a list of available reference libraries on the running computer and then determine which library of a certain type is the newest, such as the newest version of ADO? Thank you! Cory |
All times are GMT +1. The time now is 12:33 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com