Re,
deuxième essai et pas de troisième
Sub SaveODSToXLSX()
Dim StrFilename As String
Dim StrDocName As String
Dim StrPath As String
Dim obook As Workbook
Dim fDialog As FileDialog
Dim intPos As Integer
Application.ScreenUpdating = False
MsgBox "Please select the folder which contains the files for convert", , ""
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User", , "List Folder Contents"
Exit Sub
End If
StrPath = fDialog.SelectedItems.Item(1)
If Right(StrPath, 1) <> "\" Then StrPath = StrPath + "\"
End With
If Left(StrPath, 1) = Chr(34) Then
StrPath = Mid(StrPath, 2, Len(StrPath) - 2)
End If
StrFilename = Dir$(StrPath & "*.ods")
While Len(StrFilename) <> 0
Set obook = Application.Workbooks.Open(Filename:=StrPath & StrFilename, CorruptLoad:=xlRepairFile)
StrDocName = ActiveWorkbook.FullName
intPos = InStrRev(StrDocName, ".")
StrFocName = Left(StrDocName, intPos - 1)
StrDocName = StrDocName & ".xlsx"
obook.SaveAs Filename:=StrDocName, FileFormat:=51
obook.Close savechanges:=wdDoNotSaveChanges
StrFilename = Dir$()
Wend
MsgBox "Conversion is completed", , "ODS to XLSX"
Exit Sub
End Sub