Solved

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

Posted on 2004-10-20
3
294 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
Comment Utility
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
Comment Utility
You can also access the spreadsheet with ADO and then make an XML document from the recordset.

Leon
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now