Hi all,

I want to copy data from a recordset (an xml file) to an Excel spreadsheet. The following is the code fragment from a VBScript file:

Set rst = CreateObject("ADODB.Recordset")
rst.CursorLocation = 3 ' adUseClient
rst.CursorType = 3 ' adOpenStatic
rst.LockType = 1 ' adLockReadOnly
rst.Open "http://localhost/test/Final.xml", , , , 256
rst.Filter = "SRSROM = 'J18'"
Sheets(1).Cells(1, 1).CopyFromRecordset rst

My problem is that, the filter property seems not working well -- the whole recordset is imported into the spreadsheet, instead of the filtered records.

However, when I run the above code in Excel (ver 2003) VBA environment, it works (filters) perfectly.

Can anyone give me a hint on it.

Thanks in advance