Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Suresh Ramtekkar
  Where is Suresh Ramtekkar?
 Nagpur
 India
 Suresh Ramtekkar
 Tags
Subject: RE: Exporting foxpro table data to Excel
Thread ID: 248892 Message ID: 248944 # Views: 3 # Ratings: 3
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, December 25, 2009 12:12:42 PM         
   


> Hi all,
> I successfully export table data (except memo field data) to Excel. But this cannot export data of memo field to excel.
> I want to export vfp9 table data to Excel (.xls) with memo data field type.
>
> Please help me
>
> Thaking you
>
> Regard
>
> Suresh

Excel can read VFP tables by way of VFPOLEDB.DLL which comes with VFP.
There are several ways. One way is using Excel's QueryTables function:
*****
LOCAL oExcel AS Excel.APPLICATION
LOCAL oBook AS Excel.Workbook
LOCAL oSheet AS OBJECT
oExcel = CREATEOBJECT("Excel.Application")
oBook = oExcel.Workbooks.ADD
oSheet = oBook.Worksheets(1)

* 'Create the QueryTable object.
LOCAL oQryTable AS OBJECT, sNorthwind AS STRING
sNorthwind = HOME(2) +;
[NORTHWIND\NORTHWIND.DBC]
oQryTable = oSheet.QueryTables.ADD ;
("OLEDB;Provider=VFPOLEDB.1;Data Source="+sNorthwind+";", ;
oSheet.RANGE("A1"),"Select * from Orders")
oQryTable.RefreshStyle = 2 && xlInsertEntireRows = 2
oQryTable.REFRESH(.F.)
oExcel.VISIBLE=.T.
*****

-Anders

ENTIRE THREAD

Exporting foxpro table data to Excel Posted by Suresh Ramtekkar @ 12/24/2009 1:12:09 PM
RE: Exporting foxpro table data to Excel Posted by Mike Gagnon @ 12/24/2009 1:44:37 PM
RE: Exporting foxpro table data to Excel Posted by Cetin Basoz @ 12/24/2009 6:46:26 PM
RE: Exporting foxpro table data to Excel Posted by Anders Altberg @ 12/25/2009 12:12:42 PM