Solved

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

Posted on 2004-10-20
3
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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