Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel
Message
From
10/08/2003 16:52:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Re: Excel
Miscellaneous
Thread ID:
00817098
Message ID:
00818744
Views:
18
>hey,
>
>can U be more explicit on the copy a string to clipboard sollution. Could u please pass an example to us all?
>
>Thanks,
>ionut

1) Build a string and "Copy" in VFP, 2) "Paste" in Excel.

Step 1: Build string. Separate cells horizontally with tab characters; vertically with end-of-line symbols.
MyString = "Cell A1" + chr(9) + "Cell B1" + chr(13) + chr(10);
  + "Cell A2" + chr(9) + "Cell B2"
Copy to clipboard:
_ClipText = MyString
Step 2: Use Automation to locate a certain cell, and give the "Paste" command in Excel. I think you can find out the exact commands by yourself: saving a macro in Excel should give you the approximate syntax.

Note that a value like "0035" will be pasted as the number "35". If you want to avoid this, you have to format the Excel range before pasting.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform