# Reading XLS with Natural windows (SPOD)

**URL:** <https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-Database-Interfaces-on-Open-Systems, Natural-on-Windows-Unix\
**Created:** [March 20, 2008, 3:50pm UTC](https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405 "2008-03-20T15:50:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphonsstijnen](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@alphonsstijnen](https://techcommunity.softwareag.com/u/alphonsstijnen)\
**Post date:** [March 20, 2008, 3:50pm UTC](https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405/1 "2008-03-20T15:50:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [March 20, 2008, 6:14pm UTC](https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405/2 "2008-03-20T18:14:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Chad\_Scott](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Chad\_Scott](https://techcommunity.softwareag.com/u/Chad_Scott)\
**Post date:** [March 28, 2008, 12:28am UTC](https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405/3 "2008-03-28T00:28:42Z")

</div>

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. 😛

Chad.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:49pm UTC](https://techcommunity.softwareag.com/t/reading-xls-with-natural-windows-spod/76405/4 "2021-04-02T14:49:16Z")

</div>


