Save to a file with a ".wsf" extension:
<?xml version="1.0" encoding="iso-8859-2"?>
On Error Resume Next
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Scripts\Test.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
objRecordset.Open "Select * FROM [Sheet1$] Where Number = 2", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
Do Until objRecordset.EOF
Wscript.Echo objRecordset.Fields.Item("Name"), _
And then double clidk on the file's icon. Or you can just save what you have as it is and double click on the icon. However, I usually port those examples to JScript and don't know what file name extension to use for VB. I suppose it would be ".vb" or ".vba". Play around and see what works.
The XML base ".wsf" files offer you some useful extensions to the VB or JScript. And just like on a web page you can break your script into blocks that can call parts of each other and the blocks can be in different languages. Something you have to do if you are trying to create a disconnected recordset in JScript--you can't actually disconnect in JScript, you have to do that in VB.