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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Open question

Status
Not open for further replies.

waynesingh

Programmer
Apr 1, 2001
20
0
0
AU
Hi All,

I know how to create an excel spreadsheet in Progress. Eg, CREATE "excel.Application" chSpreadsheet CONNECT NO-ERROR, and then create the workbook and sheet and then populate etc. But is there an easy way to open an existing .xls file into excel? I am guessing there is an Open command, but I am not having much luck finding it.

Anyway any help offered would be appreciated,
Thank you. Wayne Singh
Analyst Programmer
Cedar Creek Company
Australia
 
I am assuming you're using 4GL:
Code:
/***********************************************/
/*  Open Excel Application                     */
/***********************************************/
DEF VAR lReturnCode AS INTEGER NO-UNDO.
PROCEDURE ShellExecuteA EXTERNAL "SHELL32.DLL":
    DEF INPUT PARAM hWnd AS LONG.
    DEF INPUT PARAM lpOperation AS CHARACTER.
    DEF INPUT PARAM lpFile AS CHARACTER.
    DEF INPUT PARAM lpParameters AS CHARACTER.
    DEF INPUT PARAM lpDirectory AS CHARACTER.
    DEF INPUT PARAM nShowCmd AS LONG.
    DEF RETURN PARAM lStatusCode AS LONG.
END PROCEDURE.
RUN ShellExecuteA ( INPUT 0,
                    INPUT "",
                    INPUT "D:\SomePath\SomeFile.xls",
                    INPUT "",
                    INPUT "",
                    INPUT 1,
                    OUTPUT lReturnCode).

IF lReturnCode <= 32 THEN MESSAGE &quot;Application Failed: &quot; lReturnCode VIEW-AS ALERT-BOX.
Hope it helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top