Excell Tricks

Excell Tricks

Postby Rochinha » Wed Sep 17, 2008 12:17 am

Hi,

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
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby Antonio Linares » Wed Sep 17, 2008 8:04 pm

Rochinha,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 26 guests