Fromat excell sheets from vb 6 application
Posted on 2004-10-29
Hi I am calling excell from vb 6 and filling it with the record set adodc2.recordset that is comming from an sql database.
the first int in the database comes into the excell file as a number. then the next row comeas as a date which is correct. The problem is that excell treis to make the following numbers into dates. Not good.
How can I format the cells in the excell to reflect the database?
here is the code I am using. Also i am not getting any headers with the code, and am not sure of how to get that. so in essence is a two part question.
Dim rst As ADODB.Recordset
Dim xl As Object
Dim wbk As Object
Set xl = CreateObject("Excel.Application")
xl.Visible = True
Set rst = Adodc2.Recordset
If Not rst.EOF Then
Set wbk = xl.Workbooks.Add
Set rst = Nothing
Thanks in advance.