Sub ExportTracks()
Dim TrackNum As String
Dim Services As String
Dim TrackServ As String
Open "Путь к файлу *.tctracks" For Output As #1
Print #1, "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <trackchecker.export version=" & Chr(34) & "0" & Chr(34) & " platform=" & Chr(34) & "android" & Chr(34) & ">"
Close #1
For Each CurRange In Selection.Rows
On Error Resume Next
If CurRange.Hidden = False Then
TrackServ = Right(ActiveSheet.Cells(CurRange.Row, 5).Value, 2)
If TrackServ = "SG" Then
Services = " <servs> <serv serv=" & Chr(34) & "sg_post" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
If TrackServ = "SE" Then
Services = " <servs> <serv serv=" & Chr(34) & "se_dl" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
If TrackServ = "NL" Then
Services = " <servs> <serv serv=" & Chr(34) & "nl_post2" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
If TrackServ = "CN" Then
Services = " <servs> <serv serv=" & Chr(34) & "china_alt" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
If TrackServ = "PI" Then
Services = " <servs> <serv serv=" & Chr(34) & "ukr_np_int" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
If TrackServ = "BE" Then
Services = " <servs> <serv serv=" & Chr(34) & "be_etr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "be_esh" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
Else
Services = " <servs> <serv serv=" & Chr(34) & "ukr" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> <serv serv=" & Chr(34) & "cn_cno" & Chr(34) & " selected=" & Chr(34) & "1" & Chr(34) & " /> </servs> </track>"
End If
End If
End If
End If
End If
End If
TrackNum = "<track comm=" & Chr(34) & ActiveSheet.Cells(CurRange.Row, 18).Value & " " & ActiveSheet.Cells(CurRange.Row, 19).Value & Chr(34) & " track=" & Chr(34) & ActiveSheet.Cells(CurRange.Row, 5).Value & Chr(34) & " desc=" & Chr(34) & ActiveSheet.Cells(CurRange.Row, 2).Value & Chr(34) & ">" _
& Services
Open "Путь к файлу *.tctracks" For Append As #1
Print #1, TrackNum
Close #1
End If
'Debug.Print CurRange.Hidden
Next
Open "Путь к файлу *.tctracks" For Append As #1
Print #1, "</trackchecker.export>"
Close #1
End Sub