Reading XLS with Natural windows (SPOD)

Is there a way to read Excel files with Natural for Windows (SPOD)??
If yes, do you have a piece of example code

Just to read any PC file is trivial; for example

dEFINE DATA LOCAL
1 #IN (A1000)
1 #C (I4)
END-DEFINE
*
DEFINE WORK FILE 1 ‘i:/documents and settings/administrator/my documents/steve robinson final.xls’
*
READ WORK FILE 1 #IN
PRINT #IN
ADD 1 TO #C
IF #C = 10
ESCAPE BOTTOM
LOOP
END

I put a limit of 10 records because I did not remember what was in the file and did not want it to run forever.

As an alternative (do not know exactly what you are trying to do) you might take a look at usr1052 which would allow you to start excel from within a natural program.

steve

To access the data from the sheets of an Excel workbook you can use the ActiveX controls that Excel provides. I posted an example of using these controls in the Open Source code samples section of this forum.

Trying to read an Excel workbook as a text document generally doesn’t provide the desired information. :stuck_out_tongue:

Chad.