Solved

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

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

Technology Partners: 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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

756 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