View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default ADO Recordset to Excel 2007 Worksheet Cell Values via XML

I haven't tried - I don't have access to Excel 2007 at work,but have you
tried dropping the table into Excel then saving the sheet as xml? or is that
the problem ...

"James Cox" wrote:

Given that Office 2007 has messed up some of the nicer ways to transfer query
results from Access to Excel, has anyone worked out a way to take an ADO
recordset in Access and convert it into the proper XML format to be written
to the XML file that holds the worksheet values in Excel 2007?

This has to be done in VBA and while Jan Karel Pieterse tells how to do a
lot of the footwork at

http://www.jkp-ads.com/Articles/Exce...leFormat02.asp

I'm wondering if there is an elegant/efficient way to convert the ADO
recordset into the kind of XML that Excel can accept. There are hints that
the recordset can be saved into a DOMDocument, but no information on how to
get it into the right format.

There is a refererence on how to do this in VB.Net at

http://support.microsoft.com/kb/319180

but that's way beyond me...

Anyone done this before?

James