Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel
Message
De
10/08/2003 16:52:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Re: Excel
Divers
Thread ID:
00817098
Message ID:
00818744
Vues:
19
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform