erreurs de portabilité de macros (excel2003)

jluc56

XLDnaute Nouveau
J'ai créé un fichier excel sur mon ordi de boulot (excel 2003) avec les macros plus bas, celà fonctionne bien, j'ai ouvert ce même fichier sur mon propre ordi (équipé en excel 2003), mais dès que j'exécute les macros voici le message d'erreur :
"ERREUR DE COMPILATION : PROJET OU BIBLIOTHEQUE INTROUVABLE !!!"
Pourtant la bibliothèque semble identique sur les deux PC :

visual basic for applications
microsoft excel 11.0 object library (...\excel.exe)
ole automation
microsoft forms 2.0 object library
microsoft excel 11.0 object library (...\fichiers communs\...
pdf creator

Je ne suis pas doué en vba....
==========================================================

Sub recherche2()

Sheets("Devis").Range("M2:O4000").ClearContents
Tablo = Sheets("base_2008").Range("A1:E65536")
chaine = InputBox("Chaine à rechercher", "saisir un mot clé : hds ou hds 895 ou 10/25 ou 60/30")
If chaine = "" Then Exit Sub


For i = 1 To UBound(Tablo, 1)

k = InStr(1, UCase(Tablo(i, 2)), UCase(chaine))
If k > 0 Then Sheets("Devis").Range("M4000").End(xlUp).Offset(1, 0) = Tablo(i, 1)
If k > 0 Then Sheets("Devis").Range("N4000").End(xlUp).Offset(1, 0) = Tablo(i, 2)
If k > 0 Then Sheets("Devis").Range("O4000").End(xlUp).Offset(1, 0) = Tablo(i, 5)
Next


End Sub


==========================================================

Sub save()
On Error Resume Next
Dim Repertoire As String
Dim Fichier As String
Dim Extension As String
Dim D$
D = Year(Now) & "_" & Format(Month(Now()), "00") & "_" & Format(Day(Now()), "00") & "_" &

Format(Hour(Now()), "00") & Format(Minute(Now()), "00") & Format(Second(Now()), "00")
Util = Environ("UserName")
FileSystem.MkDir "C:\Documents and Settings\" & Util & "\Mes documents\Devis"
Repertoire = "C:\Documents and Settings\" & Util & "\Mes documents\Devis\"
Fichier = D & "_" & Cells(6, 6).Value
Extension = ".xls"

ActiveWorkbook.SaveAs Filename:= _
Repertoire & Fichier & Extension _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

==========================================================

Sub pp()
Dim objMessage As String
Dim JobPDF As Object
Dim sNomPDF As String
Dim sCheminPDF As String

sNomPDF = ActiveWorkbook.Name & ".pdf"
sCheminPDF = ActiveWorkbook.Path & Application.PathSeparator & "PDF"

If IsEmpty(ActiveSheet.UsedRange) Then Exit Sub

Set JobPDF = CreateObject("PDFCreator.clsPDFCreator")

With JobPDF
If .cStart("/NoProcessingAtStartup") = False Then
MsgBox "Initialisation de PDFCreator impossible", vbCritical + vbOKOnly, "PDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sCheminPDF
.cOption("AutosaveFilename") = sNomPDF

' 0=PDF, 1=Png, 2=jpg, 3=bmp, 4=pcx, 5=tif, 6=ps, 7=eps, 8=txt
.cOption("AutosaveFormat") = 0

.cClearCache
End With

ActiveSheet.PrintOut Copies:=1, ActivePrinter:="PDFCreator"

'Fichier dans la file d'attente
Do Until JobPDF.cCountOfPrintjobs = 1
DoEvents
Loop
JobPDF.cPrinterStop = False

'Attendre que la file d'attente soit vide
Do Until JobPDF.cCountOfPrintjobs = 0
DoEvents
Loop
JobPDF.cClose
Set JobPDF = Nothing

End Sub
 

Discussions similaires

Réponses
2
Affichages
240

Statistiques des forums

Discussions
312 228
Messages
2 086 421
Membres
103 206
dernier inscrit
diambote