Ok, to finalize the topic completely: When I uninstalled Office from the machine (because the idea is not to have MS Office installed on a server) my code above stopped working. So I dug a bit more and it turns out the original code that Arend_ provided works just with a small tweak - it looks like HDR is not supported for Office 97-2003 files, so I just removed it and the proper code to read such files from KIX should look like this:

 Code:
$adOpenStatic = 3
$adLockOptimistic = 3
$adCmdText = &0001

$objConnection = CreateObject("ADODB.Connection")
$objRecordSet = CreateObject("ADODB.Recordset")

$objConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Scripts\Test.xls;Extended Properties=Excel 8.0;")

$objRecordset.Open("Select * FROM [Sheet1$]", $objConnection, $adOpenStatic, $adLockOptimistic, $adCmdText)

While NOT $objRecordset.EOF
  ? $objRecordset.Fields.Item("Name")
  ? $objRecordset.Fields.Item("Number")
  $objRecordset.MoveNext
Loop


Edited by green78 (2017-06-02 12:09 PM)