Here a simple code:
- Code: Select all Expand view
#include "FiveWin.ch"
Function XLSTabela()
LOCAL objExcel, objExcelsheet, objWrkBooks, objCell
amount := 50.00
taxrate := .0865
objExcel := TOleAuto():New( "Excel.Application" )
objExcelsheet := TOleAuto():New( "Excel.Sheet" )
objWrkBooks := objExcel:WorkBooks()
objCell := objExcelsheet:ActiveSheet()
objExcel:Visible := .t.
objExcel:WorkBooks:Add()
oCellA1 := objExcel:Range("A1"):Select()
objCell := objExcel:ActiveCell
objCell:Value := amount
oCellA2 = objExcel:Range("A2"):Select()
objCell := objExcel:ActiveCell
objCell:Value := taxrate
oCellA3 = objExcel:Range("A3"):Select()
objCell := objExcel:ActiveCell
objCell:Formula := "=A1*A2"
msgstop( objCell:Value )
RETURN