Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing to excel
Message
 
À
17/07/2008 11:12:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
01331963
Message ID:
01332030
Vues:
9
Cetin, hard to tell exactly what this is trying to do with the error I get on this line
.range(;
.Cells(1,.UsedRange.columns.count+1), ;
Message is "the class file (ACTIVEWORKBOOK)associated with this field cannot be found"



>>This seems complex but am looking for ideas. I want to dump a daily vfp table that produces 1 column of data with x number of rows.
>>I want to import/append this 1 column into excel in the next available blank column. so each day the available blank column progresses such as A,B,C.....AA,BB,CC etc.
>
>Actually it's easy Tim. ie:
>
>rand(-1)
>create cursor xx (myData c(10))
>for ix = 1 to int(rand()*20)
>	insert into xx values (textmerge('Day <<m.ix>>'))
>endfor
>select * from xx into array arrData
>
>
>lcXLS = 'c:\MyFolder\myDays.xls'
>
>oExcel = createobject('Excel.Application')
>oExcel.visible = .t.
>if file(m.lcXLS)
>	oExcel.Workbooks.open(m.lcXLS)
>	with oExcel.ActiveWorkBook.ActiveSheet
>	 .range(;
>		.Cells(1,.UsedRange.columns.count+1), ;
>		.Cells( alen(arrData),.UsedRange.columns.count+1)).value = getArrayRef('arrData')
>	endwith
>else
>	oExcel.Workbooks.add
>	oExcel.ActiveWorkBook.saveas(m.lcXLS)
>	with oExcel.ActiveWorkBook.ActiveSheet
>	  .range(;
>		.Cells(1,1), ;
>		.Cells( alen(arrData),1)).value = getArrayRef('arrData')
>	endwith
>endif
>oExcel.ActiveWorkBook.save
>
>function getArrayRef(tcArrayName)
>	return @&tcArrayName
>
Cetin
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform