Excel methods

Excel methods

Postby Ehab Samir Aziz » Fri Aug 04, 2006 5:01 pm

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

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

Re: Excel methods

Postby Enrico Maria Giordano » Fri Aug 04, 2006 7:12 pm

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

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ehab Samir Aziz » 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 ?
Last edited by Ehab Samir Aziz on Sat Aug 05, 2006 12:32 pm, edited 1 time in total.
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

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

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

Postby Enrico Maria Giordano » Sat Aug 05, 2006 3:41 pm

Maybe you missed my advice:

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


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ehab Samir Aziz » Sat Aug 05, 2006 8:06 pm

Thanks Enrico for your help I appreciate it. Thanks a lot
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests

cron