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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP having problems writing to the clipboard

Status
Not open for further replies.

brigmar

Programmer
Mar 21, 2006
414
US
My initial problem was to create a Multi-sheet Excel workbook from VFP sources as part of an automated procedure.

This ruled out using the COPY TO and EXPORT methods, as they create new workbooks.

So I went with Excel Automation, using the _VFP.DataToClip(,,3) command to copy my currently selected table in to the Windows clipboard, and then have Excel Paste into cell A1. This is done in a loop for each of the Sheets in the workbook.

Which works fine, for the most part.

However, some users running the report ran into problems which (to me) pointed to the _VFP.DataToClip() command NOT populating the clipboard; nothing is being pasted to Excel, and when I ctrl-V / shift-insert in another application, the clipboard is empty. We are all using VFP9 and in all cases, there is only 1 data session (the default).

Anybody else seen this problem, or have a workaround ?

 
Unless memo fields are involved, I think it might make more sense to write out several workbooks using COPY TO, and then use Automation to consolidate them into a single workbook.

Tamar
 
Brigmar,

I don't know whether this will help, but I tried the same technique once, but it failed because the amount of data being passed to _VFP.DataToClip() was too big.

Unfortunately, I didn't keep a note of what "too big" was, and, in any case, this was several versions ago. But it put me off using _VFP.DataToClip() for this purpose.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Export (groups of) DBFs to Excel Workbook QUICKLY faq184-3005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top