PC Review


Reply
Thread Tools Rate Thread

Check for the Newest Available Library

 
 
crferguson@gmail.com
Guest
Posts: n/a
 
      7th Apr 2008
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
 
Reply With Quote
 
 
 
 
JP
Guest
Posts: n/a
 
      7th Apr 2008
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, "crfergu...@gmail.com" <crfergu...@gmail.com>
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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can any tell me how the newest Win Zip compairs to the newest Winrar? RC DIY PC 2 28th Nov 2008 01:42 PM
Check where library is called from Nikolay Petrov Microsoft VB .NET 4 22nd May 2005 10:38 PM
library check in and out =?Utf-8?B?Ym9va3dvcm0=?= Microsoft Access 7 27th Dec 2004 09:00 PM
library check in and out =?Utf-8?B?Ym9va3dvcm0=?= Microsoft Excel Misc 1 18th Dec 2004 12:45 AM
Check for newest *.txt file and import data =?Utf-8?B?QUxL?= Microsoft Excel Programming 2 2nd Apr 2004 10:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:38 AM.