PDA

Click to See Complete Forum and Search --> : Export a file in EXCEL format


cu_333
Oct 5th, 2000, 01:13 AM
Hi
I'm a VB programmer and I ussaly access my files through ODBC driver using ADODB recordset and SQL statements. I want to export the result of thew sql request in Excel format. How can I do it ?

Helping me = Saving me

Thanx
CU

bar
Oct 5th, 2000, 07:05 AM
The easiest way is to use the Excel 9.0/8.0 Object Library reference.

'Declare a new Excel object:
Dim oXL as New Excel.Application

'Open it.
oXL.Open

'Write to cells using activesheet.Cell(Row,Col)
oXL.ActiveSheet.Cells(1,1) = myValue

You can reference any cell like this. I'm not sure if the code is 100% as I typed from memory, but drop me a line if you need further assistance