Link to home
Start Free TrialLog in
Avatar of abooysen2
abooysen2Flag for South Africa

asked on

Convert Excel to XML

Hi

It will be my first time but I need to upload a Excel sheet and convert it to a XML is SSIS. Is there some references
Avatar of h3nnys
h3nnys
Flag of South Africa image

Avatar of abooysen2

ASKER

The requirement is I have to do it in SSIS
If you have a well formatted xls document then there is no reason to convert it to xml all you need to do is import the xls document into ssis.
Well users will drop it on a share and I SSIS package will need to pick up the Excel sheet that the users dropped.
If you have excel, open the file and save it as in xml format and upload it, everything should work.
Can I not upload the Excel and then convert it to XML. Because I already propose that and they want to save it to a excel file
I tried this VB code but it does not work

         Dim dt As New DataTable()
        Dim ds As New DataSet
        dt.Columns.Add("Currency", String.Empty.GetType())
        dt.Columns.Add("Legal Entity", String.Empty.GetType())
        dt.Columns.Add("Account id", String.Empty.GetType())
        dt.Columns.Add("Movement", String.Empty.GetType())
        dt.Columns.Add("Value date", String.Empty.GetType())
        dt.Columns.Add("Narration", String.Empty.GetType())
        dt.Columns.Add("Counterparty", String.Empty.GetType())
        ds.Tables.Add(dt)
        Dim FILE_NAME As String = "C:\Users\anthonio.booysen\xmltest.xml"
        Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
        objWriter.Write(ds.GetXml)
        objWriter.Close()
ASKER CERTIFIED SOLUTION
Avatar of abooysen2
abooysen2
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I manage to get this to work. Took a long time but it works
I manage to get this to work. Took a long time but it works