Open XL file from ILE program

475 pts.
ILE Program
Microsoft Excel
We have a process that converts a spooled file into a .CSV file and stores it in a folder on the IFS. The user then opens Excel and locates and opens the file for editing etc. Is there a way to open up the file in Excel for them after its transferred to the IFS? Could you show me code examples please? Thank you

Answer Wiki

Thanks. We'll let you know when a new response is added.

If it is an interactive session, then you can use the STRPCO command and run excel from the iSeries

You could configure the ‘transfer data from iSeries’ button to Excel, and let them click on that to access the data directly and cut out some of that IFS nonsense…

If the conversion is batch, then you are reliant on the user initiating the process, as there is no way of telling if they are sitting at their screen.

I’d go the STRPCO route myself.. lots of examples in places like

Ops – should have tacked on to this

check the start up command for excel, something like
execl.exe -c:\directroy/file.csv’
will open the file at start up

Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • filuphaze
    Thanks Yorkshireman. I tried your suggestion of using the STRPCO and that works great, however all that does is open Excel with an empty document. Is there a way to open the file just created in Excel?
    475 pointsBadges:
  • Dave59
    As with most organisations we have a myriad of people who want excel files. What I tend to do is have programs scheduled to collect the data at set times and export to a simple excel file in the IFS (normally before they start work). The Excel spreadsheets have a start up macro to import the data. That way they don't even need to touch the iSeries (other than have an appropriate connection). Don't know if that helps or not. Dave
    45 pointsBadges:
  • Littlepd
    A few years ago, my employer (an IBM business partner & consulting firm) embarked on a path toward making excel workbooks an interface to DB2 as an alternative to 5250. We developed a set of programming standards and some baseline procedures written in VBA to run as macros inside of spreadsheets. We call them eXLerated(TM) reports. Using VBA and the OLE DB provider that comes with iSeries Access for Windows, we create forms for the users to select report criteria from drop-down lists, radio buttons, etc., which will be formatted into an SQL statement that can be run against the DB2 database. The results are returned to the VBA code, which fills in the worksheets. This method can also be used with any database for which you have an OLE DB or ODBC provider. Michael
    1,130 pointsBadges:
  • Yorkshireman
    If you check the documentation for Excel, it accepts a parameter, which is the name of the file to open. thus Excel.exe /C:file name.csv - or some such - can't remember the syntax - something PC, so weird. that will start the program and load the file.
    6,085 pointsBadges:
  • filuphaze
    Thanks again Yorkshireman. That did the trick. Thanks to all for your input. That PC stuff is always tricky.
    475 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: