Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to convert XLS to XML with vb 6.0? is it possible?

Posted on 2004-10-20
3
Medium Priority
?
319 Views
Last Modified: 2010-05-18
is there some way or some code available to convert an excel spreadsheet to xml format?

currently there is a user that uses an excel spreadsheet to save information as a litle database, he has 4 colums called 'contact_name', 'contact_phone', 'meeting_date', 'days_left', we need to create a program that convert automatically an excel spreadsheet to xml format.

thanks for all!
0
Comment
Question by:matthews_30
3 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 300 total points
ID: 12357813
If you create a Excel object, you should be able to load the workbook to it and call the workbook method, .SaveAsXMLData, like so:

    Sub SaveAsXML()
   
        Dim myXL, myWorkbook
       
        Set myXL = CreateObject("Excel.Application")
        Set myWorkbook = myXL.Workbooks.Open("x:\mypath\myfile.xls")
       
        myWorkbook.SaveAsXMLData ("x:\mypath\myfile.xml")
   
   
    End Sub

HTH

J.
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 12360878
You can also access the spreadsheet with ADO and then make an XML document from the recordset.

Leon
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question