FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Read from XLS
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Read from XLS
Posted: Thu May 22, 2008 07:53 PM

Can anyone provide sample code that reads values from an excel spreadsheet that can be stored to a variable?

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Read from XLS
Posted: Thu May 22, 2008 07:58 PM
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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Read from XLS
Posted: Sat May 24, 2008 02:18 AM

Thank You Enrico

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
Re: Read from XLS
Posted: Sat May 24, 2008 08:29 AM

Hey Darrell,

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

Patrick

;-)

Continue the discussion