Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to save .xls as a .csv or .txt from within Progress app

Status
Not open for further replies.

Natalie

Programmer
Jun 6, 2000
29
US
We will be receiving a file daily from a client that we need to import into Progress. Unfortunately, it's in Excel.

I need to automate the process of saving the file as a csv so that this import can be run with as little input as possible from the user.

From our Progress application, I would like the user to be able to select the .xls file to import, but that's it. Behind the scenes, I want to save the .xls as a .csv or .txt, then import that file.

I currently have this code to open Excel, but this isn't exactly what I want. I don't necessarily want to open Excel, but if I have to, that's fine.

DEF VAR hInstance AS INTEGER NO-UNDO.
{windows.i}
RUN ShellExecute{&A} IN hpApi(0,
"open",
"Excel.exe",
"",
"",
1,
OUTPUT hInstance).

Is there similar code I can use that will SAVE AS, and CLOSE Excel???

Thank you!!
Natalie
 
If you want to do it all from 4GL, check out chapter 6 of the Progress External Program Interfaces manual (available on progress.com). This has info on DDE (Dynamic Data Exchange). Once you link to the Excel file, you can use the DDE EXECUTE method to initiate the SaveAs routine to get your delimited file. Depending on the data you will be receiving, I would recommend a tab delimited file.

I wish I could be of more help, but I just started learning 4GL about 3 days ago.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top