J'ai ré-écris plus proprement le code en générant tout de suite le nombre d'onglets nécessaires.
Option Explicit
Sub dupliquer()
Dim ws, xl, wb, Fichier, n
Fichier = ActiveWorkbook.Name
n = Sheets.Count - 1
' creation fichier
Set xl = CreateObject("Excel.Application")
xl.SheetsInNewWorkbook = n
Set wb = xl.Workbooks.Add
'xl.Visible = True
n = 1
For Each ws In Worksheets
If ws.Name <> ActiveSheet.Name Then
With wb.Worksheets(n)
.Name = ws.Name
ws.Cells.Copy
.Paste
End With
n = n + 1
End If
Next
' sauvegarde du fichier
wb.SaveAs (ThisWorkbook.Path & "\" & Mid(Fichier, 1, InStrRev(Fichier, ".") - 1) & " " & Format(Now(), "yyyy-mm-dd") & ".xlsx"), FileFormat:=xlOpenXMLWorkbook
xl.SheetsInNewWorkbook = 1 ' On remet la propriété de l'application à ...
xl.Quit
MsgBox "Duplication terminée !"
End Sub
NOTA : je mets à la fin la propriété SheetsInNewWorkbook à 1. Mais par défaut excel met 3, c'est-à-dire 3 onglets lors de la création d'un nouveau fichier excel. Comme je hais les onglets vides, je le mets pour ma part toujours à 1, mais tu peux bien sûr changer.