>I'm developing an app where the results should be appended to an existing Excel table. I've tried the _vfp.datatoclip() and it works perfectly, except for a couple of glitches:
>
>I'm using format 3 (delimited with tabs), which pastes fine in Excel, but it seems to need some extra formatting afterwards. Excel expects character fields to be trimmed, and it loses most of the column formatting. The appearance of the field names is another unnecessary headache - I'd have to remember to delete it afterwards.
>
>I'm thinking of building the _cliptext string in this tab/cr delimited format, trimming where necessary etc. Is this the better way to do it? Or has someone already walked this path and knows of a more efficient way?
Hi Dragan,
It looks there are different way to reach the result you are looking for...
I have tried to set up a generic way to communicate information fast and properly into Excel. The way i do it :
1) - copy to temp.xls type xl5 && copy cursor into temp xls
then with Excel ole automation
2) open the temp.xls
3) copy content into clipboard
4) close the temp.xls file and delete it
5) paste clipboard content into the appropriate sheet of the appropriate document using the appropriate kind of "paste special" action you need
6) empty clipboard .. work over
This way you can fully update Excel 97 (or upward version) documents fast and clean with vfp cursor data. I encountered no formating problem ... except for general and memo fields that will not transfer:(
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement