read value cell in formula excel

tha_ndut

New Member
hi guys,
i need you help to solve my problem. how to read the value in a cell in microsoft excel if the cell in a formula by using progress.
example :
F4 =SUM(F1:F3)
F1 =IF(B1 = 0, 0, C2*C3)

Given a formula like the above, how do I get the value of F1, F2, F3, B1, C2 and C3 if it is known only formula in cell F4.

Thank you.

 

mrobles

Member
Hi.

DEFINE variable chExcelApplication AS COM-HANDLE.
DEFINE variable chWorkbook AS COM-HANDLE.
DEFINE variable chWorksheet AS COM-HANDLE.

DEF VAR valor AS CHAR.
CREATE "Excel.Application" chExcelApplication.
chExcelApplication:Visible = TRUE.
chWorkbook = chExcelApplication:Workbooks:Add().
chWorkSheet = chExcelApplication:Sheets:Item(1).

chWorkSheet:Range('B1'):Value = 5 NO-ERROR.
chWorkSheet:Range('B2'):Value = 6 NO-ERROR.
chWorkSheet:Range('B3'):Value = '=B1 + B2' NO-ERROR.
valor = chWorkSheet:Range('B3'):Value. /* <----- The answer to your question */
MESSAGE valor VIEW-AS ALERT-BOX.

RELEASE OBJECT chExcelApplication NO-ERROR.
RELEASE OBJECT chWorkbook NO-ERROR.
RELEASE OBJECT chWorksheet NO-ERROR.


MRobles
 
Top