The function of the following code is to export Excel as an XML file, in conjunction with SELECT.
Const Stsql as String = "SELECT * FROM "
Dim Stcon as String
Stcon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=" & Thisworkbook.fullname & ";" & _
"Extended properties=" "Excel 8.0; Hdr=yes "";
Dim rst as New ADODB. Recordset
Dim str as New ADODB. Stream
. CursorLocation = adUseClient
. Open Stsql, Stcon, adOpenStatic, adLockReadOnly, adCmdText
. Save str, adPersistXML
. SaveToFile "C:dzwebs.xml", Adsavecreateoverwrite
Set str = Nothing
Set rst = Nothing
Note that to use code such as above, you need to add an MS ADO library reference.