using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.Office.Interop.Excel; using ADODB; namespace VFP2Excel { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Microsoft.Office.Interop.Excel.Application xl = new Microsoft.Office.Interop.Excel.Application(); _Workbook wb = (_Workbook)xl.Workbooks.Add(System.Type.Missing); xl.Visible = true; ADODB.ConnectionClass cn = new ConnectionClass(); string connectionString = "Provider=VFPOLEDB;Data Source="+ @"C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SAMPLES\data\testdata.dbc"; ADODB.RecordsetClass rs = new RecordsetClass(); cn.Open(connectionString, "", "", 0); rs.Open("select * from customer where country like 'U%'", cn, CursorTypeEnum.adOpenUnspecified, LockTypeEnum.adLockUnspecified, 0); Range rng = ((_Worksheet)wb.ActiveSheet).get_Range("A1", "A1"); for (int i = 0; i < rs.Fields.Count; i++) { rng.get_Offset(0, i).Value2 = rs.Fields[i].Name; rng.get_Offset(0, i).Font.Bold = true; } rng.get_Offset(1, 0).CopyFromRecordset(rs, System.Type.Missing, System.Type.Missing); rs.Close(); cn.Close(); } } }From COM tab add Excel and ADO references.