FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Excel methods
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM
Excel methods
Posted: Fri Aug 04, 2006 05:01 PM
I got that error with Patrick Excel Hints :
Error description: Error BASE/1004 No exported method: CELLS
My code was :
oSheet:Cells(nLine,9):Select()
oSheet:Columns(9):AutoFit()
oSheet:Cells:Font:Bold:="Arial"
oSheet:Cells:Font:Size:=10
oSheet:Cells:Font:Name:=.t.


Also I need to add the sum function to certain columns . How can I add formula from FWH
Thanks
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Excel methods
Posted: Fri Aug 04, 2006 07:12 PM
This is a working sample (please replace SOMMA with your localized function name, ie. SUM):

FUNCTION MAIN()

    LOCAL oExcel, oSheet

    oExcel = CREATEOBJECT( "Excel.Application" )

    oExcel:WorkBooks:Add()

    oSheet = oExcel:Get( "ActiveSheet" )

    oSheet:Cells( 1, 1 ):Value = 10
    oSheet:Cells( 2, 1 ):Value = 10

    oSheet:Cells( 1, 2 ):Value = 10
    oSheet:Cells( 2, 2 ):Value = 10

    oSheet:Cells( 2, 3 ):Value = "=SOMMA(A1:A2;B1:B2)"

    oExcel:Visible = .T.

    RETURN NIL


EMG
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM
Excel methods
Posted: Sat Aug 05, 2006 12:01 PM

What is the library affected using createobject with harbour and Xharbour?
What makes the syntax is different from harbour to xharbour ?
What should I do in my batch files to compile createobject not createoleobject ?

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Excel methods
Posted: Sat Aug 05, 2006 12:06 PM
Ehab Samir Aziz wrote:What is the library affected using createobject with harbour and Xharbour?
What makes the syntax is different from harbour to xharbour ?
What should I do in my batch files to compile createobject ?


1) xHarbour: no additional libraries. Harbour: hbole.lib.

2) xHarbour: CREATEOBJECT(). Harbour: TOleAuto():New().

3) xHarbour: nothing. Harbour: add hbole.lib to the library list.

EMG
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM
Excel methods
Posted: Sat Aug 05, 2006 12:56 PM

The Whole syntax is right but when I execute the line of the SOMMA I got that error .

Unrecoverable error 9023: hb_xgrab requested to allocate zero bytes
Called from TOLEAUTO:SET(115)
Called from TOLEAUTO:_VALUE(181)
Called from EXECUTEXCEL(2699)
Called from EVAL(2641)
Called from TBUTTON:CLICK(0)
Called from TBUTTON:HANDLEEVENT(0)
Called from _FWH(0)
Called from SENDMESSAGE(0)
Called from TDIALOG:COMMAND(0)
Called from TDIALOG:HANDLEEVENT(0)
Called from TDIALOG:HANDLEEVENT(0)
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(0)
Called from BUILDEXCEL(2646)
Called from EVAL(202)
Called from TMENU:COMMAND(0)
Called from TWINDOW:COMMAND(0)
Called from TWINDOW:HANDLEEVENT(0)
Called from _FWH(0)
Called from WINRUN(0)
Called from TWINDOW:ACTIVATE(0)
Called from MAIN(136)

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Excel methods
Posted: Sat Aug 05, 2006 03:41 PM
Maybe you missed my advice:

(please replace SOMMA with your localized function name, ie. SUM)


EMG
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM
Excel methods
Posted: Sat Aug 05, 2006 08:06 PM

Thanks Enrico for your help I appreciate it. Thanks a lot

Continue the discussion