Good
For selecting either all Rows or a particular set of Rows try this
Code
Sub ExportToXml_3()
Dim x,resp, i&, ii&, iii&, iv&, lRow&, FullPath$, oMap As XmlMap
Application.ScreenUpdating = 0
With ActiveWorkbook
Set oMap = .XmlMaps("PodaciPoreskeDeklaracije_Map")
With .Sheets("Porez Srbija")
lRow = .Cells(.Rows.Count, 45).End(xlUp).Row
x = .[as4].Resize(lRow - 3)
End With
If MsgBox("Do you want to select all rows (click ""Yes""), " & _
"or particular, continuous rows (click ""No"")", vbYesNo + vbQuestion, _
"Rows to Export") = vbYes Then
ii = 1: iii = UBound(x, 1)
Else
resp = InputBox("Enter the start Row and end Row separated by a space eg. 20 40)", "Required Rows")
If resp = "" Then Exit Sub
ii = Split(resp)(0) - 3: iii = Split(resp)(1) - 3
End If
With .Sheets("PP-OPO")
For i = ii To iii
.Cells(2, 6) = x(i, 1)
Path = .Cells(2, 9): File = .Cells(3, 9)
If oMap.IsExportable Then
ActiveWorkbook.SaveAsXMLData Path & "/" & File, oMap
iv = iv + 1
Else
MsgBox "Neodgovarajuca šema za eksport XML " & objMapToExport.Name
End If
Next
Set oMap = Nothing
End With
End With
MsgBox iv & " xml files successfully exported", 64, "Completed"
End Sub
Display More
If the input box is empty when "OK" is clicked, or "Cancel" is clicked then the code will end.