Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Data From MS Excel

Status
Not open for further replies.

porto99

Technical User
Nov 1, 2004
96
GB
I need to generate a XML file to a particular format. The source of the data is MS Excel 2003.
I was planning to build a MFC C++ Dialog application in Visual Studio 2005. Does anyone know whre to find a 'Get you Started' example for C++ and MS Excel.

Someone mensions the DOM module for XML stuff, but need more info/tutorial.

Many thanks,

Porto.
 
I don't know too much about reading Excel files, but once you've got a row of data, you can simply output it to your XML file, which is basically a flat text file. Something like this (pseudocode):
Code:
openExcelFile
openXMLFile
write(XMLFile,XMLheader)
write(XMLFile,"<rows>\n")
for each row in ExcelFile
   for each field in row
      write(XMFile, "<", fieldname, ">", data, "</", fieldname, ">\n")
write(XMLFile,"</rows>\n")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top