FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Excell Tricks
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
Excell Tricks
Posted: Wed Sep 17, 2008 12:17 AM
Hi,

Here a simple code:

#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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Excell Tricks
Posted: Wed Sep 17, 2008 08:04 PM

Rochinha,

Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion