Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying to a xlsx file
Message
De
01/10/2014 01:08:51
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
30/09/2014 17:33:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01608539
Message ID:
01608600
Vues:
36
:D

I create a bit more complex data sheet with colors and depencies and so on. (the folks hand it out as data entry form and I read back, has pros and cons)
So I need to write a lot of cells with a lot of cell properties. PassArray does the trick to fill the range (Reading the range is just array = .range,property)

I've found this somewhere (UT?) a decade ago, as I run into this problem and writing cell by cell is a pain

See for example http://fox.wikis.com/wc.dll?Wiki~ExcelAutomation

Lutz

We share a beer in November in FFM?


>Interesting, as we can select into array...
>
>>>>Why row by row? There are only two ways: cell by cell or range. A range could be all at once.
>>>>If you use automation to create / save the file + writing the data as one selection of range and one value assignment will not be slower then creating a external file and importing it.
>>>>It also gives you the posibility to export memos, and do any alteration you like.
>>>
>>>I prefer the combination... do _vfp.dataToClip(,,3), remove the first line of _cliptext and then in Excel, oRange.paste() - which still doesn't work with memos, but then the memos can be handled cell by cell. The oRange.Paste() is very fast.
>>>
>>>Depending on many factors, the overhead of addressing thousands of cells may make it slower than having Excel read a file from disk and fill those cells as it will. However, this "will" is, ahem, capricious, tends to have its own opinion about several things and generally tries to outsmart you. It usually succeeds in outsmarting me, because after that I feel like a fool.
>>
>>What's wrong with
>>
>>put the stuff you need in an array, run over it to eleminate all odds (automated by the field type?) and
>>
>>loRange = .Range(.CELLS(1,1),.CELLS(ALEN(myArray,2),ALEN(myArray,1)))
>>
>>loRange.Value = PassArray('myArray')
>>
>>procedure PassArray
>> LPARA tcArray
>> return @&tcArray
>>endproc &PassArray
>>?
>>
>>I'm doing that for ages now. Most time is lost in the transformations, o.k. but then I can move all data.
>>
>>Lutz
>>
>>Edit: Changed Name of the proc to make clear it is used to pass the array ...
>>#2 I guess it column, row in excel
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform