Yep, www.hanoverpa.com
James E Harvey Hanover Shoe Farms, Inc. M.I.S./Corresponding Officer Off: 717-637-8931 fax: 717-637-6766 email: jhar...@hanoverpa.com -----Original Message----- From: profox-boun...@leafe.com [mailto:profox-boun...@leafe.com] On Behalf Of Michael Madigan Sent: Wednesday, September 01, 2010 12:02 PM To: ProFox Email List Subject: Re: excel automation I didn't know you were in the horse business. --- On Wed, 9/1/10, James E Harvey <jhar...@hanoverpa.com> wrote: > From: James E Harvey <jhar...@hanoverpa.com> > Subject: excel automation > To: "'ProFox Email List'" <profox@leafe.com> > Date: Wednesday, September 1, 2010, 12:04 PM > I'm trying to convert the "hip_no" > field from a character to numeric value > with no decimals in the resulting excel file. > > I ran an excel macro after the file was created and came up > with this, but I > can't figure how to do this in vfp programmatically? > > Selection.NumberFormat = "0" > > Here is the code to create the cursor and run to excel. > > > > select ; > "/images/photo/" + ALLTRIM(filepath) + > ".jpg" as photo, ; > "/images/pedigree/" + > ALLTRIM(filepath) + ".pdf" as pedigree, ; > "/images/video/" + > ALLTRIM(filepath) + ".rm" as videofile, ; > "/images/video/" + > ALLTRIM(filepath) + > ICASE(yrfoal="2007",".rm",yrfoal="2008",".flv",yrfoal="2009",".html"," > ") > as video, ; > COMP_NO as tattoo, ; > name, ; > color, ; > SEX, ; > GAIT, ; > iif(DATE_FOAL <> {}, > dtoc(DATE_FOAL),dtoc({})) as DATE_FOAL, ; > SIRE1 as sire, ; > DAM1 as dam, ; > HIP_NO, ; > LOC_SOLD as sale, ; > iif(DATE_SOLD<> {}, > dtoc(DATE_SOLD),dtoc({})) as DATE_SOLD, ; > price_sold as sale_price, ; > alltrim(buy_name) as buyer ; > from lcfile3 ; > order by ; > DATE_FOAL desc, DAM1 ; > into cursor lcfile4 > > > oexcel = createobject("excel.application") > obook = oexcel.workbooks.add() > orange = oexcel.activesheet.range("a1:p1") > > > with oexcel.activesheet > .range("a1") = "Photo" > .range("b1") = "Tattoo" > .range("c1") = "Name" > .range("d1") = "Color" > .range("e1") = "Sex" > .range("f1") = "Gait" > .range("g1") = "Date Foal" > .range("h1") = "Sire" > .range("i1") = "Dam" > .range("j1") = "Hip No." > .range("k1") = "Pedigree" > .range("l1") = "Video" > .range("m1") = "Sale" > .range("n1") = "Date Sold" > .range("o1") = "Sale Price" > .range("p1") = "Buyer" > > > orange = orange.offset(1,0) > > > scan > > nlastrow = > orange.row-1 > ntotalrow = > nlastrow+1 > > with orange > > .columns[1].value = photo > > .columns[2].value = [="] + alltrim(tattoo) +["] > > .columns[3].value = name > > .columns[4].value = color > > .columns[5].value = SEX > > .columns[6].value = GAIT > > .columns[7].value = DATE_FOAL > > .columns[8].value = sire > > .columns[9].value = dam > > .columns[10].value = HIP_NO > > .columns[11].value = pedigree > > .columns[12].value = video > > .columns[13].value = sale > > .columns[14].value = DATE_SOLD > > .columns[15].value = sale_price > > .columns[16].value = buyer > endwith > > orange = > orange.offset(1,0) > > endscan > > James E Harvey > Hanover Shoe Farms, Inc. > M.I.S./Corresponding Officer > Off: 717-637-8931 > fax: 717-637-6766 > email: jhar...@hanoverpa.com > > > [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/09df01cb4a10$81085450$8318fc...@com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.