Bonjour à tous,
j'aimerais insérer ce code ActiveWorkbook.CheckCompatibility = False dans la macro suivante :
mais je ne sais pas ou l'intégrer pour qu'il fonctionne.
Sub essai()
Dim fs, f, f1, fc, s
Dim a(26)
Application.ScreenUpdating = False
specdossier = RepIni(ActiveWorkbook.Path)
If specdossier = "" Then Exit Sub
fic = ActiveWorkbook.Name
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(specdossier)
Set fc = f.Files
pos = 15
For Each f1 In fc
s = f1.Name
b = Right(s, 3)
If b = "xls" And s <> ActiveWorkbook.Name Then
ActiveSheet.Unprotect ("123")
Workbooks.Open Filename:=specdossier & "\" & s
Sheets("FV").Activate
a(1) = Cells(15, 1)
a(5) = Cells(15, 5)
a(7) = Cells(15, 7)
a(11) = Cells(15, 11)
a(15) = Cells(15, 15)
a(20) = Cells(15, 21)
a(22) = Cells(15, 26)
a(23) = Cells(15, 22)
a(24) = Cells(15, 24)
ActiveWorkbook.Close
Windows(fic).Activate
Sheets("FV").Activate
For u = 1 To 26
Cells(pos, u) = a(u)
Next u
pos = pos + 1
End If
Next
ActiveSheet.Protect ("123")
End Sub
Function RepIni(Defaut As String)
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
With fd
.Filters.Clear
.Title = "Selectionner le répertoire de départ"
.InitialFileName = Defaut
If .Show = -1 Then
RepIni = fd.SelectedItems(1)
End If
End With
Set fd = Nothing
End Function
merci d'avance pour votre aide.
cordialement
sebelec