Link to home
Start Free TrialLog in
Avatar of RVL
RVL

asked on

append excel into foxpro memo field

I'm trying to append from an XLS file with one of the columns going into a memo field. When I try this, the Memo field keeps coming up empty.
I'm using FoxPro v9 sp2.  I want to do this programatically, avoiding manual steps of importing excel into access then exporting to dBaseIV then opening Fox.  

  sXLSFile = GETFILE('XLS')
  CREATE CURSOR curTest (memodata m)
  APPEND FROM (sXLSFile) type xl8
  GO TOP
  SCAN
    sThisIsEmpty = LEFT(curTest.memodata,254)
  ENDSCAN
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

To append data from XLS file to memo field by APPEND FROM command is not allowed in VFP. Also to copy data from memo field to XLS file is not allowed.

To do this work you have to use different approach, e.g. Excel OLE Automation, Clipboard copy, ODBC connection to Excel sheet etc. If you have less than 255 characters in Excel column then you may import them into character field and converto to memo later. ODBC connection obviously creates memo field from even from short texts.
ASKER CERTIFIED SOLUTION
Avatar of GreatSolutions
GreatSolutions
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, exactly. AppendFromExcel() uses ODBC connection to Excel as stated in my first post. Thanks for the link.

It does not need Excel but it needs Office Data Connectivity Components installed (http://www.microsoft.com/downloads/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en)

Office 2010 version is also available.
Geez Pavel, you are a living VFP encyclopedia, it's a great pleasure reading your posts :-)

Jaime