Solved

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

Posted on 2004-10-20
3
295 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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now