Open XL file from ILE program
325 pts.
0
Q:
Open XL file from ILE program
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
ASKED: Mar 5 2009  8:00 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
3200 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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 midrange.com



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
Last Answered: Mar 11 2009  8:29 AM GMT by Yorkshireman   3200 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Filuphaze   325 pts.  |   Mar 6 2009  6:22PM GMT

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?

 

Dave59   45 pts.  |   Mar 9 2009  8:24AM GMT

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

 

Littlepd   500 pts.  |   Mar 9 2009  6:32PM GMT

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

 

Yorkshireman   3200 pts.  |   Mar 11 2009  8:27AM GMT

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.

 

Filuphaze   325 pts.  |   Mar 11 2009  1:17PM GMT

Thanks again Yorkshireman. That did the trick. Thanks to all for your input. That PC stuff is always tricky.

 
0