bonjour,
en effet, la macro utilise des instructions non disponibles sur mac.
voici une alternative qui devrait fonctionner sur mac. adapter éventuellement la manière dont on nomme le fichier XML et vérifier s'il ne faudra modifer le paramètre encoding dans l'entête du fichier xml.
Sub export_XML()
fname = "nomdufichier.xml" '<- à adapter
Dim fsT As Object
XMLstring = "<XML version=""1.0"" encoding=""UTF-8"">" & vbNewLine & "<Grille-des-programmes>"
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"
With ws
DL = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To DL
XMLstring = XMLstring & vbNewLine & vbTab & "<Day day=""" & ws.Name & """>"
For col = 1 To 9
If .Cells(i, col) <> "" Then XMLstring = XMLstring & vbNewLine & vbTab & vbTab & "<" & .Cells(2, col) & ">" & .Cells(i, col).Text & "</" & .Cells(2, col) & ">"
Next col
XMLstring = XMLstring & vbNewLine & vbTab & "</Day>"
Next i
End With
End Select
Next ws
XMLstring = XMLstring & vbNewLine & "</Grille-des-programmes>" & vbNewLine & "</XML>"
Open fname For Output As 1
Print #1, XMLstring
Close 1
MsgBox "fichier " & fname & " créé"
End Sub