LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel missing library

Hi ! everybody

I try to find a way to repear effects of missing library when a workbook
travel from an environnement to another one.

Of course, I don't want to do it manualy, but automatically.

I've found some procedures but they don't seems to work finely :

for instance : why do that one don't work ?
Don't matter with french strings...

The .Name and .FullPath Properties can't be read if the library is missing !
The library can't be removed if missing !

How can we remove a missing library ?

Thank's a lot for answers ! and sorry for language errors

'=======================
Sub AddMissingRefs()
'examine les références d'un projet, repère celles qui
'sont déclarées manquantes et essaye de les réinstaller

Dim LesRefs As Object, i&, Msg$, Cpt&, Rep&, Mnq&, Chemin$, Nom$

Set LesRefs = ThisWorkbook.VBProject.References
For i = 1 To LesRefs.Count
With LesRefs(i)
If .IsBroken Then
Mnq = Mnq + 1: Chemin = .FullPath: Nom = .Name
LesRefs.Remove LesRefs.Item(.Name)
If Dir(Chemin) = "" Then
Msg = "La librairie " & Nom & " est manquante et le fichier" &
vbLf
Msg = Msg & "'" & Chemin & "'" & vbLf
Msg = Msg & "ne peut être trouvé pour l'installer."
MsgBox Msg, vbCritical
Cpt = Cpt + 1
Else
LesRefs.AddFromFile Chemin
Rep = Rep + 1
End If
End If
End With
Next i

If Mnq 0 Then
If Cpt 0 Then Msg = Cpt & " référence(s) toujours manquante(s)"
If Rep 0 Then Msg = Msg & Rep & "référence(s) réinstallée(s)"
End If

End Sub

'================================



--

Bien cordialement,

Joël GARBE
www.joelgarbe.fr


 
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
Missing library??? pcor New Users to Excel 0 November 26th 06 04:25 PM
missing object library eagle7 Excel Discussion (Misc queries) 2 November 6th 05 04:06 AM
Missing Library Jan Il Excel Worksheet Functions 2 March 19th 05 04:56 PM
Missing library? Ko Vijn Excel Programming 4 February 5th 04 11:23 PM
Library missing.. Warrio[_2_] Excel Programming 2 October 27th 03 06:28 PM


All times are GMT +1. The time now is 02:29 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"