'Convert Excel data into Xml file streams
Function getSheetXml ()
Dim sXml
Dim I
Dim sXmlRow
Dim ProductGroup
'Header file stream'
SXml = "<root> <version> <t>" & ReportName & "</t>"
'Traverse each Excel Data and convert it into an Xml file stream
For I = MinRow To RetMaxRow-1
SXmlRow = ""
SXmlRow = "<record> "&_
"<RowIndex>" & XmlEncode (I) & "</RowIndex> "&_
"<Quarter>" & XmlEncode (Trim (Cells (I, 1) & "</Quarter> "&_
"<WeekNo>" & XmlEncode (Trim (Cells (I, 2) & "</WeekNo> "&_
"<BPCode>" & XmlEncode (Trim (Cells (I, 3) & "</BPCode> "&_
"<BPType>" & XmlEncode (Trim (Cells (I, 4) & "</BPType> "&_
"<BusinessUnit>" & XmlEncode (Trim (Cells (I, 5) & "</BusinessUnit> "&_
"<Product/Metric>" & XmlEncode (Trim (Cells (I, 6) & "</Product/Metric> "&_
"<Finalised Rebate>" & XmlEncode (Trim (Cells (I, 7) & "</Finalised Rebate> "&_
"</Record>"
SXml = sXml & sXmlRow
Next
'Back to xml file stream
GetSheetXml = sXml & "</root>"
End Function