code vba ActiveWorkbook.CheckCompatibility = False à insérer

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

SEBELEC16

XLDnaute Nouveau
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
 
Re : code vba ActiveWorkbook.CheckCompatibility = False à insérer

Bonjour,

essaye peut être ceci, à placer avant l'enregistrement du classeur ou sa fermeture :
Code:
If CDbl(Application.Version) > 11 Then ActiveWorkbook.CheckCompatibility = False

bonne journée
@+
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
309
  • Question Question
XL 2021 VBA excel
Réponses
4
Affichages
191
Réponses
2
Affichages
532
Réponses
3
Affichages
517
  • Question Question
Microsoft 365 Export données
Réponses
4
Affichages
667
Retour