Page 1 of 1

Read from XLS

Posted: Thu May 22, 2008 7:53 pm
by cdmmaui
Can anyone provide sample code that reads values from an excel spreadsheet that can be stored to a variable?

Re: Read from XLS

Posted: Thu May 22, 2008 7:58 pm
by Enrico Maria Giordano

Code: Select all

FUNCTION MAIN()

    LOCAL oExcel := CREATEOBJECT( "Excel.Application" )

    LOCAL oSheet

    oExcel:WorkBooks:Open( "E:\XHARBOUR\TEST.XLS" )

    oSheet = oExcel:ActiveSheet

    ? oSheet:Cells( 1, 1 ):Value
    ? oSheet:Cells( 2, 1 ):Value
    ? oSheet:Cells( 3, 1 ):Value

    ? oSheet:Range( "A1" ):Value

    oExcel:Quit()

    RETURN NIL
EMG

Posted: Sat May 24, 2008 2:18 am
by cdmmaui
Thank You Enrico

Re: Read from XLS

Posted: Sat May 24, 2008 8:29 am
by Patrick Mast
Hey Darrell,

Is that picture-logo you use here the Brooks and Dunn logo?

;-)

Patrick