Skip to main content

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.
If I may be so liberate, it is not quite obvious what is your problem, please provide some more explanation next time.

However, as your subject is: "I am trying to read from excel", I suppose what you want is how to get the content from a cell.

This is how you would extend your current sample to do that:

INQUIRE EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value IN field.

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.
If I may be so liberate, it is not quite obvious what is your problem, please provide some more explanation next time.

However, as your subject is: "I am trying to read from excel", I suppose what you want is how to get the content from a cell.

This is how you would extend your current sample to do that:

INQUIRE EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value IN field.

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.
At first i try to inquire but still have the error is member not found.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.

For me is the handle excel-worksheet that seen to don't have the correct value.

So i try that

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.

MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.


MOVE "A1" TO excel-CELL-RANGE.
inquire EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.

And i have the error invalid member or something like that.

Thank for your reply!

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.
Worksheets is a collection so you need to specify which item in the collection you want, for instance the first sheet is 1 :

inquire EXCEL-WORKBOOK
@Worksheets::Item(1) in EXCEL-WORKSHEET.

or by name:

inquire EXCEL-WORKBOOK
@Worksheets::Item("Sheet1") in EXCEL-WORKSHEET.

[Migrated content. Thread originally posted on 03 March 2003]

CREATE @Application OF @Excel HANDLE IN EXCEL-APP.
MODIFY EXCEL-APP @SheetsInNewWorkBook = 1.
MODIFY EXCEL-APP @GetOpenFilename()
GIVING FIELD.


MODIFY EXCEL-APP @Workbooks::Open(FIELD)
GIVING EXCEL-WORKBOOK.

MODIFY EXCEL-APP @VISIBLE = 1.


inquire EXCEL-WORKBOOK
@application::Worksheets() in EXCEL-WORKSHEET.
>>> this give a handle but ot the one that the active worksheet


MOVE "A1" TO excel-CELL-RANGE.
MOVE "Quarterly Sales Figures for 2002" TO field.

MODIFY EXcel-WORKSHEET
@Range(excel-CELL-RANGE)::Value = field.
Worksheets is a collection so you need to specify which item in the collection you want, for instance the first sheet is 1 :

inquire EXCEL-WORKBOOK
@Worksheets::Item(1) in EXCEL-WORKSHEET.

or by name:

inquire EXCEL-WORKBOOK
@Worksheets::Item("Sheet1") in EXCEL-WORKSHEET.