How to create an Excel .csv

How to create an Excel .csv

Postby Rick Lipkin » Thu Dec 11, 2008 1:52 pm

To All

Does anyone have an example on how to create an Excel .csv comma delimited useing TOleAuto() ??

Many Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: How to create an Excel .csv

Postby Enrico Maria Giordano » Thu Dec 11, 2008 4:40 pm

Code: Select all  Expand view
#define xlCSV 6


FUNCTION MAIN()

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

    LOCAL oSheet

    oExcel:WorkBooks:Add()

    oSheet = oExcel:ActiveSheet

    oSheet:Cells( 1, 1 ):Value = "This is a test 1"
    oSheet:Cells( 1, 2 ):Value = "This is a test 2"
    oSheet:Cells( 1, 3 ):Value = "This is a test 3"

    oExcel:ActiveWorkBook:SaveAs( "E:\XHARBOUR\SAVED.CSV", xlCSV )

    oExcel:ActiveWorkBook:Close( 0 )

    oExcel:Quit()

    RETURN NIL


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


Return to FiveWin for Harbour/xHarbour

Who is online

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