>>Hi Alvin,
>>
>>In addition to what the others have mentioned, you can store multiple fields and records by using the DataToClip() method. While I haven't experimented with it using OLE automation, interactively, if you use 3 as the data format parameter, the field names, and data will be copied directly into individual cells in an Excel spreadsheet.
>>
>>hth,
>Hi George,
>It works with OLE :)
>Alvin, what George suggests is same as one cell pasting but exceptionally faster if you would do that for multipl cells.
>application.datatoclip("myalias",reccount("myalias"),3)
>oExcel.activeworkbook.activesheet.paste.
>Only bothering thing datatoclip places an extra empty column which I couldn't understand. Also it bombs with large record sets (2000 is safe but not 3000 - should be limited with memory or something like that).
>PS: Just for one cell you could use this notation too :
>oExcel.activeworkbook.activesheet.cells(nRow,nCol).value = "Cliptextvalue"
Hi Cetin,
Thanks for the heads up. I'd always been curious on the usage of this method, but never had gotten around to messing with it. I figured that it would worked with OLE automation, but since I had never tested it...
Interesting about the extra column and the limitations with data sets of more than 2,000 records. This last item in some cases, however, can be gotten around. Very often, data in spreadsheets is or can be represented by a cross table. If appropriate, generating one and sending that to Excel could greatly reduce the required number of records.
George
Ubi caritas et amor, deus ibi est