Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy to worksheet

Status
Not open for further replies.

finglem

Technical User
Nov 14, 2003
66
GB
Hi folks

Is it possible to issue the 'copy to filename type xls'
command to a worksheet rather than a workbook? ie can I open an existing workbook and copy the data to a particular sheet without automation?

Automation is OK but can be a bit slow for some purposes.

Thanks
 

Hi Finglem,

No. You can use the SHEET clause with APPEND FROM, but not with COPY TO or EXPORT.

It's true that Automation would be slow if you transferred a large table row by row. But you can speed it up in a couple of ways.

You can use _VFP.DataToClip to get the table into the clipboard, and then, with Automation, execute Excel's Paste command to get it into the sheet.

Or, use COPY TO to get it to Sheet1 of a temporary workbook, then, with Automation, copy that sheet to the target workbook.

Both methods would be reasonably fast.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike. Nice to hear from you again.

I kind of guessed that I might have to do something like you have suggested. At least I now know for sure.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top