Excel methods

Post Reply
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Excel methods

Post by Ehab Samir Aziz »

I got that error with Patrick Excel Hints :
Error description: Error BASE/1004 No exported method: CELLS
My code was :

Code: Select all


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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Excel methods

Post by Enrico Maria Giordano »

This is a working sample (please replace SOMMA with your localized function name, ie. SUM):

Code: Select all

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
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

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 ?
Last edited by Ehab Samir Aziz on Sat Aug 05, 2006 12:32 pm, edited 1 time in total.
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

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)
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Maybe you missed my advice:
(please replace SOMMA with your localized function name, ie. SUM)
EMG
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

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