Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel to recognize FoxPro memo fields?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00393509
Message ID:
00393554
Vues:
16
Automation is controling another program, like Excel, from VFP. AFAIK is As Far As I Know. Here's the response I got from George Tasker when I asked for example code:
Not that tough. Off the top of my head:
LOCAL oExcel, lnlast, lcalias, lvalue, lnrow
oExcel = CREATEOBJECT('Excel.Application')
* Create a new work sheet
oExcel.Workbooks.Add
lcalias = ALIAS()
lnlast = FCOUNT()
lnrow = 0
SCAN
  lnrow = lnrow + 1
  FOR lni = 1 TO lnlast
    lccell = CHR(64 + lni) + TRANSFORM(lnrow)
    oExcel.Range(lccell).Select
    lvalue = lcalias + "." + FIELD(lni)
    oExcel.ActiveCell.Value = &lvalue
  NEXT
ENDSCAN
Of course, if you have more than 26 fields, you'll have to make an adjustment in the column name.
>What do you mean by "Automation"? and what is AFAIK?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform