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
Printable View
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
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