Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel to recognize FoxPro memo fields?
Message
From
17/07/2000 17:17:49
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00393509
Message ID:
00393554
Views:
19
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform