Justin
asked on
How to convertan Excel file into XML
Hi, I have to convert on a daily basis an Excel file to XML. Can someone guide me into how to do the attached?
Murex_02June2016.xlsx
Murex_02June2016.xlsx
@JCutcliffe
you will very much like my solution as attached. simple as this.
please open this file and then choose the path to export the XML file and click ok and it is done.
i acknowledging part of code from Raymond Pang from Codeproject.
please let me know.
EE.xlsm
you will very much like my solution as attached. simple as this.
please open this file and then choose the path to export the XML file and click ok and it is done.
i acknowledging part of code from Raymond Pang from Codeproject.
please let me know.
EE.xlsm
ASKER
Which button do you use "Process using GenearteXMLObj" or "Process using fGenerateXML"? Also, do I have to type the file path in the "Export to Following file" field as when I click on "Browse" nothing happens?
please use Process using fGenerateXML
also the file path is default where the workbook is saved itself. you can change the file path by typying there. i did not work on the browse icon.
also the file path is default where the workbook is saved itself. you can change the file path by typying there. i did not work on the browse icon.
ASKER
I did it but all that came out in the xml file was "<?xml version="1.0"?>
<data> </data>"
Copy-of-EE.xlsm
<data> </data>"
Copy-of-EE.xlsm
ASKER
Any ideas?
becuase your header should have a back slash and also the DATA prefix. like this /Data/TRADER
The selected region on excel sheet, with the first row as field name, and data rows below
For the field name, use the node delimiter "/" to build the hierarchy of data e.g. /data/TRADER is equvalent to <data><TRADER>....</TRADER ><data>
The selected region on excel sheet, with the first row as field name, and data rows below
For the field name, use the node delimiter "/" to build the hierarchy of data e.g. /data/TRADER is equvalent to <data><TRADER>....</TRADER
ASKER
So I just have to edit the first row then, eg. "Nominal" changes to "/Data/Nominal" ?
ASKER
It works! Is there a way to bring up the Macros buttons whilst still in the file instead of closing and opening the file to get the Macro buttons?
yes.
insert a new module and put this code.
then either assign a shortcut key or run the Test macro and it will bring up that form
insert a new module and put this code.
Sub Test()
Startform.show
End Sub
then either assign a shortcut key or run the Test macro and it will bring up that form
ASKER
Just ran it and it said Run-time error '424' Object required. I assigned a Macro button from Design Mode in the Developer ribbon to it.Any ideas?
can you please send me your latest file and i will build on it.
Just a comment. I don't think this will totally help your situation, but just so you know, Excel files are compressed XML files. Just open with decompression program like 7-zip and you may be out to a good start.
ASKER
here you go. Can you get rid of that "Excel warning message about sharing personal information too?
MUREX-2ND-JUNE.xlsm
MUREX-2ND-JUNE.xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent
Excel to XML Conversion in Visual Studio
you can get a downloadable version at below link
How to Convert excel file to xml format (CSOpenXmlExcelToXml)
hope this helps.